
On Sep 6, 2006, at 4:15 PM, David Abrahams wrote:
The problem is that is_convertible
::value is not yet known, and (aside from the fact that there's an implicitly generated copy ctor that's a perfect match which the compiler seems to ignore at this stage, of course)
Consistently so, for both g++3.x and g++4.x. (Am I missing something, or is this not sufficiently weird to register as a problem?)
without that ::value the compiler can't decide whether either of those constructors is a match for a Foo argument. In fact, we're only checking for that match because we want to know that very ::value!
Got it. The compiler can't instantiate is_convertible
Right. So again, it seems as though it isn't possible to do what I'm trying to do.
Sure it is. You could use
enable_if< mpl::or_
, is_convertible >, ... > Type sameness can be determined without looking at constructors or even knowing anything about the definition of the type.
I see...skip the is_convertible<> check when the types are actually the
same, thus avoiding the instantiation of is_convertible