Re: [Boost-users] behavior conditional on template argument

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"
To: boost-users@lists.boost.org 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-td185...
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Hicham Mouline a écrit :
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,
There is a set of macro that I uploaded in the Vault under the name 'introspection' IIRC that contaisn such macros. It's still incomplete but works for common case. I have to ironing out for Visual and stome other quirky compiler. -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35
participants (2)
-
Hicham Mouline
-
Joel Falcou