Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2003-01-12 01:01:51


----- Original Message -----
From: "Paul Mensonides" <pmenso57_at_[hidden]>

Actually, this works too:

template<class T> struct is_ptr_to_mem_fun {
    enum { value = false };
};

template<class R, class C> struct is_ptr_to_mem_fun<R C::*> {
    private:
        template<class, class> struct helper {
            enum { value = false };
        };
        template<class U> struct helper<void (U), void (U)> {
            enum { value = true };
        };
    public:
        enum { value = helper<void (R), void (R*)>::value };
};

The idea being that the function type (if that is what it is) is adjusted to
a pointer-to-function type.

Paul Mensonides


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk