Open tap opened 9 years ago
Sweep through to improve type-safety and static_asserts.
Here is a related trick that recently came across my screen:
We can take one from optional's book and fake constrain the constructor to avoid implicit conversions: struct bar { template <typename T, typename = std::enable_if_t<std::is_same<T, in_place_t>{}>> bar(in_place_t(*)(T)){} };
We can take one from optional's book and fake constrain the constructor to avoid implicit conversions:
struct bar { template <typename T, typename = std::enable_if_t<std::is_same<T, in_place_t>{}>> bar(in_place_t(*)(T)){} };
http://en.cppreference.com/w/cpp/types/is_same http://stackoverflow.com/questions/16924168/compile-time-function-for-checking-type-equality
Sweep through to improve type-safety and static_asserts.
Here is a related trick that recently came across my screen: