Re: sigc::mem_fun and Glib::RefPtr
- From: klaus triendl <klaus triendl eu>
- To: klaus triendl <klaus triendl eu>, Horváth Imre <blemidon gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: sigc::mem_fun and Glib::RefPtr
- Date: Thu, 4 Oct 2012 22:33:53 +0200
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]