Re: sigc::mem_fun and Glib::RefPtr



Am Thu, 4 Oct 2012 22:07:16 +0200
schrieb klaus triendl <klaus triendl eu>:

> namespace sigc
> {
> 
> // the partially specialized struct dereference_trait is essential,
> // otherwise sigc can't deduce the return type from expression
> *sigc::_1
> 
> template <class T>
> struct dereference_trait<std::shared_ptr<T> >
>   { typedef T type; };
> 
> template <class T>
> struct dereference_trait<std::shared_ptr<T>& >
>   { typedef T type; };
> 
> }

sorry, the struct dereference_trait should make a reference typedef:

<code>
namespace sigc
{

// the partially specialized struct dereference_trait is essential,
// otherwise sigc can't deduce the return type from expression *sigc::_1

template <class T>
struct dereference_trait<std::shared_ptr<T> >
  { typedef T& type; };

template <class T>
struct dereference_trait<std::shared_ptr<T>& >
  { typedef T& type; };

}
</code>


greetings,
klaus


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]