mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 20:34:26 +02:00
refactor: SymbolicConstant
moved to _expression_template.h_
This commit is contained in:
@@ -193,11 +193,4 @@ template<template<auto...> typename T, typename T1, typename T2, typename... Ts>
|
||||
return get<T, T2, Ts...>();
|
||||
}
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<typename T>
|
||||
concept SymbolicConstant = std::is_empty_v<T> && std::is_final_v<T>;
|
||||
|
||||
}
|
||||
|
||||
} // namespace mp_units
|
||||
|
@@ -31,13 +31,28 @@
|
||||
#ifdef MP_UNITS_IMPORT_STD
|
||||
import std;
|
||||
#else
|
||||
#include <concepts>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace mp_units {
|
||||
|
||||
namespace detail {
|
||||
|
||||
// `SymbolicArg` is provided because `SymbolicConstant` requires a complete type which is not the case
|
||||
// for `OneType` below.
|
||||
template<typename T>
|
||||
concept SymbolicArg = (!std::is_const_v<T>) && (!std::is_reference_v<T>);
|
||||
|
||||
template<typename T>
|
||||
concept SymbolicConstant =
|
||||
SymbolicArg<T> && std::is_empty_v<T> && std::is_trivial_v<T> && std::semiregular<T> && std::is_final_v<T>;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/**
|
||||
* @brief Type list type used by the expression template framework
|
||||
*
|
||||
|
Reference in New Issue
Block a user