Boost logo

Ublas :

Subject: Re: [ublas] enable complex @ int
From: Neal Becker (ndbecker2_at_[hidden])
Date: 2009-10-07 19:24:26

Gunter Winkler wrote:

> Am Friday 02 October 2009 schrieb Neal Becker:
>> How do you feel about adding my patch?
> good idea:
> We need a somehow general solution like the one suggested by Matwey. But
> we should of course provide a robust solution, too.
> Could you please make a short unit test (similar to the nice tests for
> the new free functions)?
> mfg
> Gunter
How about:
      template<typename R, typename I>
      typename boost::enable_if<
            std::complex<R> >::type inline operator+ (I in1, std::complex<R> const&
in2 ) {
        return R (in1) + in2;