Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-10-01 08:16:28


"Neal D. Becker" <nbecker_at_[hidden]> writes:

> A nice addition to type_traits would be: is_complex.
>
> I'm not sure how to use add it in the current framework of type_traits. A
> simple native implementation could be something like:
>
> template<typename T>
> struct IsCmplx {
> static const bool Yes = false;
> };
>
> template<typename FLT>
> struct IsCmplx<std::complex<FLT> > {
> static const bool Yes = true;
> };

voila:

http://www.boost-consulting.com/boost/boost/python/detail/is_xxx.hpp

    #include <boost/python/detail/is_xxx.hpp>
    BOOST_PYTHON_IS_XXX_DEF(complex, std::complex, 1)

and you're done.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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