Simbody
3.3
|
SimTK::conjugate<R> should be instantiated only for float, double, long double. More...
#include <String.h>
SimTK::conjugate<R> should be instantiated only for float, double, long double.
This should behave just like std::complex<R> and in most cases we'll just convert and punt to the std class.
The three specializations are almost identical, but differ in the rules for implicit conversion. Implicit conversions are allowed from a narrow type to a wider one, but the other direction must be explicit.
Some of this could be done more compactly with member templates, helper classes and so on, but this can make debugging of client programs very awkward, both by producing indecipherable error messages when compiling and by referencing unexpanded template code when debugging. Since this class need only be done once, and has a grand total of three specializations, I felt it made more sense to do each of them explicitly here (sherm 051006).