Re: init of class members : mem(0) vs. mem() vs. not-init at all
On Jan 27, 11:16 pm, "Balog Pal" <p...@lib.hu> wrote:
"James Kanze" <james.ka...@gmail.com>
Has this changed since ARM ? (i tested 3 "older"
compilers (before 2000) and all 3 do not initialize mem
with mem().
For the record, the first C++ standard was published in 99,
IIRC, so chances are that compilers didn't catch up within
a year.
The first C++ standard was officialized in 1998 (not 1999).
Most, if not all, compiler vendors were members of the
committee, however, and once the final committee draft was
adopted (about a year before officialization), they could start
work.
And they did too -- so crap like the CD2 version of auto_ptr
made it to the real life librarier and stuck there...
Some things turned out to be more volatile than others:-).
But value-init (I guess) we're talking about entered the
standard only in 2003. So we can't expect compilers ~2000
having it.
The exact specification of how initialization occurs was changed
in 2003, but the basic idea, that T() resulted in the same
initialization as when you declare a static T object, was
present in the 1998 version of the standard (although I think it
was proposed and added fairly late in the process).
--
James Kanze