xo-unit: + constexpr implementation (runtime+compiletime)
This commit is contained in:
parent
3643f6a0a0
commit
5bde1bfb94
12 changed files with 820 additions and 0 deletions
23
include/xo/unit/quantity2_concept.hpp
Normal file
23
include/xo/unit/quantity2_concept.hpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/** @file quantity2_concept.hpp **/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "unit_concept.hpp"
|
||||
#include "numeric_concept.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace unit {
|
||||
template <typename Quantity>
|
||||
concept quantity2_concept = requires(Quantity qty, typename Quantity::repr_type repr)
|
||||
{
|
||||
typename Quantity::unit_type;
|
||||
typename Quantity::repr_type;
|
||||
|
||||
{ qty.scale() } -> std::same_as<typename Quantity::repr_type>;
|
||||
//{ Quantity::unit_cstr() } -> std::same_as<char const *>;
|
||||
//{ Quantity::unit_quantity() } -> std::same_as<Quantity>;
|
||||
//{ Quantity::promote(repr) } -> std::same_as<Quantity>;
|
||||
} && (true //unit_concept<typename Quantity::unit_type>
|
||||
&& numeric_concept<typename Quantity::repr_type>);
|
||||
} /*namespace unit*/
|
||||
} /*namespace xo*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue