opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
liboscar
maths
scalar.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <concepts>
4
5
namespace
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::
float
ing_po
int
T>
16
struct
IsScalar
<
T
>
final
{
17
static
constexpr
bool
value
=
true
;
18
};
19
20
template
<std::
int
egral 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>
29
concept
Scalar
=
IsScalarV<T>
;
30
31
template
<
typename
T>
32
concept
ScalarOrBoolean
=
Scalar<T>
or
std::same_as<bool, T>;
33
}
osc::ScalarOrBoolean
Definition
scalar.h:32
osc::Scalar
Definition
scalar.h:29
osc
Definition
custom_decoration_generator.h:5
osc::Key::T
@ T
osc::to
constexpr U to(T &&value)
Definition
conversion.h:56
osc::IsScalarV
constexpr bool IsScalarV
Definition
scalar.h:26
osc::IsScalar
Definition
scalar.h:11
osc::IsScalar::value
static constexpr bool value
Definition
scalar.h:12
Generated by
1.9.8