11#include <uni20/config.hpp>
89inline constexpr std::array configured_scalar_precisions{
105 return detail::configured_scalar_precisions;
116#if UNI20_HAS_FLOAT128
136 return std::forward<Function>(function).template operator()<
float32>();
138 return std::forward<Function>(function).template operator()<
float64>();
141 return std::forward<Function>(function).template operator()<float80>();
143 throw std::invalid_argument(
"fp80 is not available in this Uni20 build");
146#if UNI20_HAS_FLOAT128
147 return std::forward<Function>(function).template operator()<float128>();
149 throw std::invalid_argument(
"fp128 is not available in this Uni20 build");
152 throw std::invalid_argument(
"invalid Uni20 scalar precision");
Definition async/async.hpp:26
constexpr bool scalar_precision_is_available(ScalarPrecision precision)
Report whether a runtime precision has a concrete scalar type in this build.
Definition scalar_precision.hpp:72
float float32
Definition types.hpp:22
constexpr bool has_float80
Whether this build provides native x87 extended precision as uni20::float80.
Definition scalar_precision.hpp:33
double float64
Definition types.hpp:23
constexpr bool has_float128
Whether this build provides a concrete uni20::float128 type.
Definition scalar_precision.hpp:36
ScalarPrecision
Runtime identifier for the real precision underlying a scalar type.
Definition scalar_precision.hpp:25
constexpr std::string_view configured_scalar_precision_choices()
Return a compact choice list suitable for command-line help.
Definition scalar_precision.hpp:110
constexpr std::string_view scalar_precision_name(ScalarPrecision precision)
Return the canonical command-line and diagnostic spelling of a precision.
Definition scalar_precision.hpp:41
decltype(auto) visit_scalar_precision(ScalarPrecision precision, Function &&function)
Invoke a templated callable with the concrete real scalar for a runtime precision.
Definition scalar_precision.hpp:131
constexpr std::optional< ScalarPrecision > parse_scalar_precision(std::string_view name)
Parse a canonical scalar precision name independently of build availability.
Definition scalar_precision.hpp:60
constexpr std::span< ScalarPrecision const > configured_scalar_precisions()
Return the real scalar precisions configured in this build.
Definition scalar_precision.hpp:103