Boost logo

Boost Users :

Subject: Re: [Boost-users] [enable_if] Compile Time Member Overloading
From: Christian Henning (chhenning_at_[hidden])
Date: 2012-11-19 19:15:56


> #include <boost/mpl/and.hpp>
> #include <boost/type_traits/is_same.hpp>
> #include <boost/utility/enable_if.hpp>
>
> using namespace boost;
>
> struct foo
> {
> void bla()
> {
> read_data_24<int, int>();
> }
>
> template< typename T1, typename T2>
> void read_data_24(typename enable_if_c< is_same< T1, T2 >::value>::type* =
> 0)
>
> {
> int i = 9;
> }
> };
>
> int main(int argc, char* argv[])
> {
> return 0;
> }
>

Thanks for info. It's a good idea to use enable_if_c!

Christian


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