Boost logo

Boost :

Subject: Re: [boost] GSOC 2010 - BGL Graph Connectives.
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-04-12 15:12:14


AMDG

nguyen vu tri wrote:
> I am sorry for my confusing question. I wrote the template like this:
> ------------------------------------------------------------------------------
> template <> // double
> struct Is_Type<double> { static const int value = 0;};
>
> template <> // int
> struct Is_Type<int> { static const int value = 1;};
>
> ------------------------------------------------------------------------------
>
> And then, I call Is_Type<typename>::value to compare and figure if two
> types are different :
> ------------------------------------------------------------------------------
> if ( Is_Type<int>::value == Is_Type<double>::value )
> ------------------------------------------------------------------------------
>
> However, I think there is a huge number of types. Therefore, this solution
> will not be efficient.
> I would like to ask if you could suggest me a better way.
>

boost::is_same<int, double>::value

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk