Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-03-17 18:47:08


Ian McCulloch wrote:
> Peter Dimov wrote:

[...]

> I don't get it: can't you detect whether
> nested::result<nested(T)>::type exists? As long as the primary
> template of nested::result is defined as an empty struct this should
> work fine(?).

No, consider what happens when 'nested' is int (*) (), for example.

>> This won't help us in general, though. result_of is not supposed to
>> support SFINAE, because it may be implemented with __typeof or
>> __decltype internally.
>
> Do you mean that a substitution failure in a typeof or decltype
> expression *is* an error? Ouch!

The current C++ compilers can't backtrack on an error, so once
decltype(expr) triggers a complicated chain of events potentially involving
multiple implicit template instantiations, there is no way back. Or so I
hear. :-)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net