Agument to constexpr functions

Pages: 12
I'm not aware of that reason, either.
For example, if it were allowed, this would be well-formed program on some implementations, and ill-formed on some others.
1
2
3
4
5
template< double > struct X {} ;

void function( X< 1.0 > ) {}

void function( X< 1.00000000001 > ) {}


Even if, for argument's sake, this were to be allowed, it would make writing cross-compilers very hard (A cross-compiler would have to accurately emulate the target platform's floating point environment at compile time.)

A design goal is that entities in namespace std should, to the extent possible, have the same meaning across implementations; code using the standard library should be portable code.
Topic archived. No new replies allowed.
Pages: 12