Boost logo

Boost Users :

Subject: Re: [Boost-users] How to test if a type is of some form?
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2008-09-24 07:57:31


Peng Yu wrote:
> Hi,
>
> I want to test if template argument is of some form like in the
> following code. I could define some helper class to do such test. But
> I'm wondering if there is any easy to do it with boost? The
> type_traits's is_same does not work in this case. I'm wondering if
> there could be some generalization of it.
>
> template <T>
> void f() {
> //For example, I want to test if T is of the
> // form of std::complex<S>
> }

Have you looked at the Type Traits library, is_same, remove_cv, ...

Jeff


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