Mail Archives: djgpp/2012/05/29/20:45:16
Hi,
On May 29, 12:05 pm, Hans-Bernhard Bröker <HBBroe DOT DOT DOT AT t-online DOT de>
wrote:
> On 28.05.2012 22:31, Georg wrote:
>
> > I try to port a Linux program that includes<vector.h>. This file is
> > not in my djgpp include directory.
>
> Nor is it supposed to be. Not any more, anyway. <vector.h> is a way
> pre-standard name (and implementation) of what eventually became the C++
> standard header <vector>
>
> There's very little, if any justification for any program to still be
> trying to use such outdated library components.
I admire your expertise in these areas, of course, but this particular
view is a bit simplistic.
The existences of standards are pretty random in what they include or
exclude, and none is perfect for everybody. Also, are some standards
better than other standards? The real issue is whether whatever
platform(s) Georg is targeting both supports the newer standard as
well as the older "de facto" standard. C++ has existed in various
forms since 1979. The books (according to Wikipedia) came out in 1985
(1st ed.), 1991 (2nd), and 1997 (3rd) + 2000 (3rd, special).
So while it's easy to champion C++98, let's not forget that a lot of
pre-existing code is probably still floating around. Also, in case it
wasn't obvious, I was implying that C++11 is out, hence "newer" and
"better". (But DJGPP doesn't fully support that yet, so I guess that's
not recommended.) I don't know if I agree with the idea that all old
code must "mandatory" be updated to newer standards when it "just
works" fine already.
I know I'm overthinking it, and I know some of this isn't what you
really meant, but it's a slippery slope.
P.S. I had thought I read somewhere that part of the idea of
"<vector>" instead of "<vector.h>" was to optionally allow backwards
compatibility if the vendor chose to do so. I guess GCC did not.
Considering their apparent support of standards when possible, I'm not
totally surprised, but I really don't know the details. EDIT: Aha! I
had forgotten that some "/backward/" files were removed after G++
4.2.3. So, Georg, it's there in older versions if you really want it.
(I know you don't now, just saying, for completeness ....)
2721 2008-02-12 00:23 include/cxx/4.23/backward/vector.h
- Raw text -