I'm working on a C++ maths library in which I want to be able to configure at compile time using defines.
One of the configurations is defining the precision. In code it looks like this:
#ifdef MYMATH_USE_DOUBLE
typedef double Real;
#else
typedef float Real;
#endif
That works fine.
If someone wants to then use the library after it has been configured with MYMATH_USE_DOUBLE they'll have to also pass that define to the compiler.
Is there a better way of doing this?
I don't want the user to have to remember what defines were used to compile the maths librarys and then repeat them all for their app.