Boost logo

Boost :

Subject: [boost] [OT] std::complex warts
From: Neal Becker (ndbecker2_at_[hidden])
Date: 2012-11-07 15:27:08

std::complex doesn't seem to allow mixing of types in arithmetic operations.
This is quite inconvenient for code that is generic on the base float type.

For example:

template<typename flt_t>
flt_t some_function (std::complex<flt_t> z) {
  return 2. * z / 4.2 + ...


This will fail to compile when flt_t == float (but succeeds for double).

casting every constant in a large computation is really not an acceptable


Boost list run by bdawes at, gregod at, cpdaniel at, john at