
Hello, trying out Pete Becker's "c++ std lib ext" exercises, ex1 p155 #include <iostream> #include <typeinfo> #include <boost/utility/result_of.hpp> typedef float (*floatfct)(float); int main(int argc, char* argv[]) { typedef typename boost::result_of<floatfct(float, float)>::type resultype; std::cout<< typeid(resultype).name() << std::endl; } should fail, because result_of is instantiated with a callable type with 2 float args, while it's been defined as taking 1 float arg only? with intel10.1-MSVC8-boost1.35, it links. rds,

Hicham, as far as I understand your code you pass to result_of a new type: typedef typename boost::result_of<floatfct(float, float)>::type resultype; This type is a pointer to a function type, which has as return type a pointer to floatfct and as params float, float. That's why it compiles. Regards, Ovanes On Thu, May 1, 2008 at 1:25 PM, Hicham Mouline <hicham@mouline.org> wrote:
Hello, trying out Pete Becker's "c++ std lib ext" exercises, ex1 p155
#include <iostream> #include <typeinfo> #include <boost/utility/result_of.hpp>
typedef float (*floatfct)(float); int main(int argc, char* argv[]) { typedef typename boost::result_of<floatfct(float, float)>::type resultype; std::cout<< typeid(resultype).name() << std::endl; }
should fail, because result_of is instantiated with a callable type with 2 float args, while it's been defined as taking 1 float arg only?
with intel10.1-MSVC8-boost1.35, it links.
rds, _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Hicham Mouline
-
Ovanes Markarian