I'm implementing a function as follows:
template <typename FP>
void do_something(FP f){
static_assert(std::is_floating_point<FP>::value, "not a floating point");
...
}
In this context, any floating point can be used (native or custom, i.e. multi-precision float libraries).
I wonder if standard states anything about what to expect from types overloading the is_floating_point. Can I count for them being required to work with FENV?
Can I assume the following code should work properly if a custom floating point implementation is overloading the std::is_floating_point?
template <typename FP>
void do_something(FP f){
static_assert(std::is_floating_point<FP>::value, "not a floating point");
if (std::fetestexcept(FE_DIVBYZERO)){
...
}
}
Aucun commentaire:
Enregistrer un commentaire