BasicRatio< T > Struct Template Reference
A basic rational fraction, constexpr-compatible. More...
#include <Rational.h>
Inheritance diagram for BasicRatio< T >:
Collaboration diagram for BasicRatio< T >:
Public Member Functions | |
| operator String () const | |
Public Attributes | |
| T | num |
| T | den |
Detailed Description
template<typename T>
struct BasicRatio< T >
A basic rational fraction, constexpr-compatible.
- Note
- Adding a constructor would prevent things like this:
constexpr BasicRatio ratio {1, 5}; We can use BasicRatio to do things like creating tables of ratios, which can then be used in std::ratio calls to perform compile-time arithmetic.
Member Function Documentation
◆ operator String()
template<typename T>
|
inline |
Member Data Documentation
◆ den
template<typename T>
| T BasicRatio< T >::den |
◆ num
template<typename T>
| T BasicRatio< T >::num |
The documentation for this struct was generated from the following file:
1.8.13