
Vicente J. Botet Escriba wrote:
is there any reason result_of couldn't use decltype when available? That is, could Boost define BOOST_RESULT_OF_USE_DECLTYPE when decltype is supporeted?
First, (almost) all current implementation of decltype does not support N3276.
Non-N3276-decltype requires type-completeness, while traditional result_of
does not. So result_of with non-N3276-decltype is incompatible with
the traditional result_of.
We should proceed gradually even if N3276-decltype is available, because
* decltype-based result_of can break user codes with (unintended) use
of result_of.
* Implementation of N3276-decltype might be buggy for some time.
Daniel already made a first step by updating the documentation.
The doc on trunk says:
In a future release, BOOST_RESULT_OF_USE_DECLTYPE may be enabled
by default on compilers that support decltype, so if you use the above
protocol please take care to ensure that the result_type and
result<> members accurately represent the result type.
If you wish to continue to use the protocol on compilers that
support decltype, use boost::tr1_result_of, which is also defined
in