
Hal Finkel wrote:
Do you mean proto-izing std::complex itself (or some derived class), or using (extending) proto::terminal < std::complex >?
The later
On a related note, is there a standard way (yet) of changing a single component of std::complex? I'm not sure that there is... i always did z.imag() = x; My rationale for using an array value type was to make the interpretation of the type as a 2-element array clean. I'm working with several scientific codes which contain complex types defined as: typedef double complex_t[2]; and I'm preparing to port them to use more modern C++. However, I think that your point about the use of intrinsic functions is a good one.
Well, I ended up having an additional tempalte parameter (much like deque)
that may change the way the internal values are stored.
complex<T> <- internally use std::complex
complex