Boost logo

Boost Users :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2004-12-25 16:14:49


Hossein Haeri writes:
> Dear all,
>
> According to the Boost.Type_Traits I guess that
> function_traits<> is supposed to be of the most docile
> ones. After all it's got a few lines of comment...
>
> Don't know how, and why, but the following plain-jane
> programme
>
> #include <iostream>
> #include "boost\type_traits\function_traits.hpp"
>
> int main()
> {
> typedef void (*FType) ();
                  ^

Should be

    typedef void (FType) ();

> typedef
> typename
> boost::function_traits<FType>
> ::result_type return_type;
>
> cin.get();
> return 0;
> }
>
> Gives me the following error under GCC 3.3.1 (which
> I'm sure supports partial template specialisation):

[...]

>
> Is he right? Is there anything particular I should had
> done, and I've not?

'function_traits' requires you to pass a _function type_,
which is a different beast from a pointer to a function.

HTH,

--
Aleksey Gurtovoy
MetaCommunications Engineering

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