Boost logo

Boost Users :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2007-03-15 07:25:51


Filip Konvi?ka ha escrito:

> I've been playing with the problem too, and found this solution...it
> does not rely on typeof, but it does rely on return_type. I'm a bit
> unsure about why I had to use "unsigned int" to make it work, so I'd
> welcome some comments on this.

Do you mean you couldn't use RetType properly? I've tried with
the following in GCC 3.2:

  template<class T, typename MemberType, MemberType T::* MemberPtr,
  typename RetType, RetType (MemberType::*MemberFct)() const>
  struct extract_and_call {
      typedef RetType result_type;
      RetType operator()(T const& t) const {
          return ((t .* MemberPtr) .* MemberFct)();
      }
  };

and everything seems to be working fine.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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