libfxd 0.2.dev
A fixed-point library for C++.
|
Return fxd::expect::maybe<...>
result.
More...
Namespaces | |
namespace | down |
Round down. | |
namespace | up |
Round up. | |
namespace | zero |
Round to zero. | |
Typedefs | |
template<typename T > | |
using | maybe = detail::expected< T, error > |
Alias to std::expected , or an equivalent implementation. | |
Functions | |
template<int Int, int Frac, typename Raw = detail::select_int_t<Int + Frac>, std::convertible_to< fixed< Int, Frac, Raw > > Src> | |
constexpr maybe< fixed< Int, Frac, Raw > > | make_fixed (Src src) |
Convenience overload. | |
template<int Int, int Frac, typename Raw = detail::select_uint_t<Int + Frac>, std::convertible_to< fixed< Int, Frac, Raw > > Src> | |
constexpr maybe< fixed< Int, Frac, Raw > > | make_ufixed (Src src) |
Convenience overload (unsigned version). | |
template<int Int, int Frac, typename Raw = fxd::detail::select_int_t<Int + Frac>, fixed_point Src> | |
constexpr maybe< fixed< Int, Frac, Raw > > | fixed_cast (Src src) noexcept |
Convenience overload. | |
template<int Int, int Frac, typename Raw = fxd::detail::select_uint_t<Int + Frac>, fixed_point Src> | |
constexpr maybe< fixed< Int, Frac, Raw > > | ufixed_cast (Src src) noexcept |
Convenience overload (unsigned version). | |
template<fixed_point Dst, std::convertible_to< Dst > Src> | |
constexpr maybe< Dst > | assign (Dst &dst, Src src) noexcept |
Assignment. | |
template<fixed_point Fxd> | |
constexpr maybe< Fxd > | pre_inc (Fxd &f) noexcept |
Pre-increment (++f ). | |
template<fixed_point Fxd> | |
constexpr maybe< Fxd > | post_inc (Fxd &f) noexcept |
Post-increment (f++ ). | |
template<fixed_point Fxd> | |
constexpr maybe< Fxd > | pre_dec (Fxd &f) noexcept |
Pre-decrement (--f ). | |
template<fixed_point Fxd> | |
constexpr maybe< Fxd > | post_dec (Fxd &f) noexcept |
Post-decrement (f-- ). | |
Return fxd::expect::maybe<...>
result.
Alias to std::expected
, or an equivalent implementation.
Definition at line 27 of file expect.hpp.
|
constexprnoexcept |
Assignment.
Definition at line 105 of file expect.hpp.
Convenience overload.
Definition at line 70 of file expect.hpp.
Convenience overload.
Definition at line 40 of file expect.hpp.
Convenience overload (unsigned version).
Definition at line 53 of file expect.hpp.
|
constexprnoexcept |
Post-decrement (f--
).
Definition at line 171 of file expect.hpp.
|
constexprnoexcept |
Post-increment (f++
).
Definition at line 138 of file expect.hpp.
|
constexprnoexcept |
Pre-decrement (--f
).
Definition at line 157 of file expect.hpp.
|
constexprnoexcept |
Pre-increment (++f
).
Definition at line 124 of file expect.hpp.
Convenience overload (unsigned version).
Definition at line 85 of file expect.hpp.