How can I check that instances of MyDouble
will be created at compile time?
What will happen if I instantiate MyDouble
with a non-constant expression?
#include <iostream>
struct MyDouble{
double myVal;
constexpr MyDouble(double v): myVal(v){}
constexpr double getVal(){ return myVal; }
};
int main() {}