Created on 2007-06-06.00:00:00 last changed 196 months ago
[Voted into the WP at the September, 2008 meeting.]
Notes from the July, 2007 meeting:
The CWG agreed with the suggestion to allow such calls in unevaluated contexts.
Issue 506 changed passing a non-POD class type to an ellipsis from undefined behavior to conditionally-supported behavior. As a result, an implementation could conceivably reject code like the following:
struct two {char _[2];}; template <class From, class To> struct is_convertible { private: static From f; template <class U> static char test(const U&); template <class U> static two test(...); public: static const bool value = sizeof(test<To>(f)) == 1; }; struct A { A(); }; int main() { const bool b = is_convertible<A,int>::value; // b == false }
This technique has become popular in template metaprogramming, and no non-POD object is actually passed at runtime. Concepts will eliminate much (perhaps not all) of the need for this kind of programming, but legacy code will persist.
Perhaps this technique should be officially supported by allowing implementations to reject passing a non-POD type to ellipsis only if it appears in a potentially-evaluated expression?
History | |||
---|---|---|---|
Date | User | Action | Args |
2008-10-05 00:00:00 | admin | set | messages: + msg1809 |
2008-10-05 00:00:00 | admin | set | status: ready -> cd1 |
2008-06-29 00:00:00 | admin | set | status: review -> ready |
2008-05-18 00:00:00 | admin | set | messages: + msg1651 |
2008-05-18 00:00:00 | admin | set | status: drafting -> review |
2007-08-05 00:00:00 | admin | set | messages: + msg1519 |
2007-08-05 00:00:00 | admin | set | status: open -> drafting |
2007-06-06 00:00:00 | admin | create |