Temporary half-precision expression. This class represents a half-precision expression which just stores a single-precision value internally.
| 351 | /// Temporary half-precision expression. |
| 352 | /// This class represents a half-precision expression which just stores a single-precision value internally. |
| 353 | struct expr |
| 354 | { |
| 355 | /// Conversion constructor. |
| 356 | /// \param f single-precision value to convert |
| 357 | explicit HALF_CONSTEXPR expr(float f) HALF_NOEXCEPT : value_(f) {} |
| 358 | |
| 359 | /// Conversion to single-precision. |
| 360 | /// \return single precision value representing expression value |
| 361 | HALF_CONSTEXPR operator float() const HALF_NOEXCEPT { return value_; } |
| 362 | |
| 363 | private: |
| 364 | /// Internal expression value stored in single-precision. |
| 365 | float value_; |
| 366 | }; |
| 367 | |
| 368 | /// SFINAE helper for generic half-precision functions. |
| 369 | /// This class template has to be specialized for each valid combination of argument types to provide a corresponding |