| 290 | |
| 291 | template <typename T, typename = std::enable_if_t<!std::is_same<std::decay_t<T>, numeric>::value>> |
| 292 | numeric(T &&dat) |
| 293 | { |
| 294 | if (std::is_floating_point<std::decay_t<T>>::value) { |
| 295 | type = 0; |
| 296 | data._num = static_cast<numeric_float>(dat); |
| 297 | } |
| 298 | else if (std::is_integral<std::decay_t<T>>::value) { |
| 299 | type = 1; |
| 300 | data._int = static_cast<numeric_integer>(dat); |
| 301 | } |
| 302 | else |
| 303 | throw runtime_error("Construct numeric with incompatible type."); |
| 304 | } |
| 305 | |
| 306 | numeric(const numeric &rhs) : data(rhs.data), type(rhs.type) {} |
| 307 |
no test coverage detected