Boost logo

Boost Users :

Subject: [Boost-users] [proto] Question on grammar and operator overloading
From: Hal Finkel (half_at_[hidden])
Date: 2009-10-05 22:00:42


Hello,

I'm writing a complex number class using boost::proto by extending
proto::terminal< boost::array<_, 2> >. I've attached a copy of my
current code, which compiles, runs, and (at least with both g++ and icc
on my machine) demonstrates a significant speed improvement compared to
std::complex.

However, there is (at least) one thing which don't work as it should:

In the grammar I have to specify lazy_complex< double > instead of
lazy_complex< _ >, otherwise the compiler cannot find proto's operator
overloads, why?

Note: This code will not compile under 1.37, but will compile under
1.40, because of some issue in 1.37 which manifests itself as a problem
with the overloading of the '<<' operator. I've not tested the releases
in between 1.37 and 1.40.

General suggestions are also welcome. I'd like to get this cleaned up
for general redistribution.

Thank you in advance,
Hal




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