|
Boost : |
From: AlisdairM (alisdair.meredith_at_[hidden])
Date: 2007-01-05 18:47:46
I am a little confused by the result_of tests, which means either I
don't understand the library, or there is a problem as most compilers
are passing!
The basic case:
struct int_result_type { typedef int result_type; };
BOOST_STATIC_ASSERT
((
is_same< result_of< int_result_type(float) >::type, int >::value
));
If I understand correctly, this is asking what is the result_of a
function taking a float and returning an int_result_type. Intuitively,
and from my reading of the tr1 docs, that should be an int_result_type,
not an int as asserted in the test.
My reading of tr1 says that result_of< int_result_type > should return
an int, but NOT functions that return an int_result_type. This support
being in there to support unary_function, binary_function, and other
function objects following that protocol.
-- AlisdairM
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk