Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-01-05 14:53:25


Foster, Gareth wrote:
>> boost::is_function<int(int)>::value
>
>> I know it's confusing. Most C++ programmers never see a function
>> type in the wild. You can use remove_pointer to turn a
>> pointer-to-function into a function.
>
> Could I do ...
>
> int (int) * p_my_function_pointer;

No, but you can do

    typedef int my_function( int );

and now do

    my_function * my_function_pointer;

You can even do

    struct X
    {
        my_function f;
    };

but don't ask me why you'd want or need to do that.


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