|
Boost Users : |
Subject: Re: [Boost-users] behavior conditional on template argument
From: Hicham Mouline (hicham_at_[hidden])
Date: 2009-01-21 09:26:53
That is a beautiful trick.
The sizeof trick basically.
"C++ template metaprogramming" p212
As Joel says in that post, it should definitely be included in standard boost.
Perhaps in the type traits library?
thank you,
> ----- Original Message -----
> From: "Igor R" <boost.lists_at_[hidden]>
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] behavior conditional on template argument
> Date: Wed, 21 Jan 2009 13:17:56 +0200
>
>
> >
> > You can use enable_if to let the compiler decide which one it should
> > instantiate. And the argument will be a custom defined type trait. I
> > think there are facilities to automatically define it on the presence
> > of a type, there may be soemthing for fucntions as well, but I don't
> > remember where they live (MPL ?)
>
>
> Here it is:
> http://www.nabble.com/compile-time-check-that-a-member-function-exists-td18596485.html
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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