-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
RepresentationOf
concept now also accepts a QuantitySpec
…
…and accepts any representation character for quantity kinds
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -159,15 +159,28 @@ A `Reference` can either be: | |||||||||||||||||||||||||||||||||||||
[value of a quantity](../../appendix/glossary.md#quantity-value). | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
### `RepresentationOf<T, Ch>` { #RepresentationOf } | ||||||||||||||||||||||||||||||||||||||
### `RepresentationOf<T, V>` { #RepresentationOf } | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
`RepresentationOf` concept is satisfied by all `Representation` types that are of a specified | ||||||||||||||||||||||||||||||||||||||
[quantity character](../../appendix/glossary.md#character) `Ch`. | ||||||||||||||||||||||||||||||||||||||
`RepresentationOf` concept is satisfied: | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- if the type of `V` satisfies [`QuantitySpec`](#QuantitySpec): | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- by all [`Representation`](#Representation) types when `V` describes | ||||||||||||||||||||||||||||||||||||||
a [quantity kind](../../appendix/glossary.md#kind), | ||||||||||||||||||||||||||||||||||||||
- otherwise, by [`Representation`](#Representation) types that are of | ||||||||||||||||||||||||||||||||||||||
a [quantity character](../../appendix/glossary.md#character) associated with a provided | ||||||||||||||||||||||||||||||||||||||
quantity specification `V`. | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- if `V` is of `quantity_character` type: | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- by [`Representation`](#Representation) types that are of a provided | ||||||||||||||||||||||||||||||||||||||
[quantity character](../../appendix/glossary.md#character). | ||||||||||||||||||||||||||||||||||||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mpusz
Author
Owner
|
namespace detail { | |
template<typename T> | |
struct value_type_impl { | |
using type = T; | |
}; | |
template<typename T> | |
requires requires { typename wrapped_type_t<T>; } | |
struct value_type_impl<T> { | |
using type = wrapped_type_t<T>; | |
}; | |
} // namespace detail | |
template<typename T> | |
requires std::is_object_v<T> | |
using value_type_t = detail::value_type_impl<T>::type; |
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
mpusz
Nov 8, 2024
Author
Owner
We should move it to mp_units
and possibly to customization_points.h
if we want to expose it as a customization point.
This seems backwards to me.
We don't say that
int
represents a scalar quantity character.Isn't the character of a quantity suppose to describe the set of its numerical value?