Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2004-03-15 18:50:46


"Andy Little" <andy_at_[hidden]> wrote
> "Neal D. Becker" <ndbecker2_at_[hidden]> wrote
> > I believe some parts of pqs may be just what I need for some other
> purposes.

[snip]

>
> >particularly since it
> > appears to include std::complex.

reviewing my work for binary_operation with regard to complex. I think that
the following covers it as far as the definition goes. Not tested thoroughly
but appears to cover all including inbuilts etc... (Yes that means I can
remove a lot of unnecessary specialisations from pqs/complex.. :-) ). Should
also bring in functors as described previously

regards
Andy Little

----------------------------------

#ifndef GENERIC_COMPLEX_BINARY_OPERATION_HPP_INCLUDED
#define GENERIC_COMPLEX_BINARY_OPERATION_HPP_INCLUDED

#include "boost/pqs/meta/binary_operation.hpp"
#include <complex>
/*
specialisation of binary_operation<std::complex<T>,Op,std::complex<T> >
*/
namespace boost{namespace pqs{ namespace meta{

    template<
        typename Value_typeL,
        template <typename> class Op,
        typename Value_typeR
>
    struct binary_operation<
        typename std::complex<
           Value_typeL
>,
        Op,
        typename std::complex<
          Value_typeR
>
>{
        typedef typename std::complex<
            typename binary_operation<
                Value_typeL,
                Op,
                Value_typeR
>::result_type
> result_type;
    };
}}}//boost::pqs::meta

#endif


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