
On 5/27/2012 11:32 AM, John M. Dlugosz wrote:
I turned on BOOST_RESULT_OF_USE_DECLTYPE and used boost::result_of because the std::tr1::result_of that comes with VS10 doesn't use declspec at all and thus doesn't work right with lambda functions.
This passes my unit tests, but fails on a piece of code that has a function returning an instantiation of boost::optional.
It seems confused as to whether the value held in the optional is as-specified or has a reference added to it.
I wonder if this is a specific issue with optional that might be addressed/worked-around/patched, or perhaps there is a way to enable declspec-based testing just for the code that wanted it and not globally?
Your best bet is to file a bug against boost.optional. Be sure to include a small, complete example that demonstrates the problem. Disclaimer: I am not the maintainer of boost.optional. -- Eric Niebler BoostPro Computing http://www.boostpro.com