opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
scalar.h
Go to the documentation of this file.
1#pragma once
2
3#include <concepts>
4
5namespace osc
6{
7 // metaclass that has a `value` member equal to `true` if its type argument
8 // behaves like a scalar (which is checked when resolving overloads of matrices
9 // and vectors)
10 template<typename>
11 struct IsScalar final {
12 static constexpr bool value = false;
13 };
14
15 template<std::floating_point T>
16 struct IsScalar<T> final {
17 static constexpr bool value = true;
18 };
19
20 template<std::integral T>
21 struct IsScalar<T> final {
22 static constexpr bool value = true;
23 };
24
25 template<typename T>
26 inline constexpr bool IsScalarV = IsScalar<T>::value;
27
28 template<typename T>
30
31 template<typename T>
32 concept ScalarOrBoolean = Scalar<T> or std::same_as<bool, T>;
33}
Definition scalar.h:32
Definition scalar.h:29
Definition custom_decoration_generator.h:5
constexpr U to(T &&value)
Definition conversion.h:56
constexpr bool IsScalarV
Definition scalar.h:26
Definition scalar.h:11
static constexpr bool value
Definition scalar.h:12