Re: std::abs ambiguity
On Apr 30, 12:53 am, joshuamaur...@gmail.com wrote:
On Apr 29, 1:28 am, James Kanze <james.ka...@gmail.com> wrote:
The next version of the standard will make all three
approaches legal. So it's anyone's guess as to whether a
given bit of code will actually work on another compiler or
not.
Really? That seems most atrocious.
It's already the case for a lot of other things. Ideally, one
would like the same rule as in C---a header is allowed to define
what it is required to define, and nothing else. Practically,
that's not implementable---you can't very well define
std::vector (in <vector>) without a definition for the default
allocator (in <memory>) or std::reverse_iterator (in
<iterator>); if the compiler doesn't support export, you
might also need <new> (or more likely, <memory> requires <new>,
so you get it indirectly). So the rule was adopted that any C++
header can include any other. So there are all sorts of code
which compiles with one implementation, and not with another,
because the author forgot to include a header.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34