The Sparta Modeling Framework
Loading...
Searching...
No Matches
TreeNodeExtensionsSupport.hpp
1
#pragma once
2
3
#include <type_traits>
4
#include <vector>
5
#include <string>
6
#include <cstdint>
7
8
namespace
sparta::extensions {
9
10
template
<
typename
T>
11
struct
is_supported_scalar
: std::false_type {};
12
13
template
<>
struct
is_supported_scalar
<int8_t> : std::true_type {};
14
template
<>
struct
is_supported_scalar
<uint8_t> : std::true_type {};
15
template
<>
struct
is_supported_scalar
<int16_t> : std::true_type {};
16
template
<>
struct
is_supported_scalar
<uint16_t> : std::true_type {};
17
template
<>
struct
is_supported_scalar
<int32_t> : std::true_type {};
18
template
<>
struct
is_supported_scalar
<uint32_t> : std::true_type {};
19
template
<>
struct
is_supported_scalar
<int64_t> : std::true_type {};
20
template
<>
struct
is_supported_scalar
<uint64_t> : std::true_type {};
21
template
<>
struct
is_supported_scalar
<double> : std::true_type {};
22
template
<>
struct
is_supported_scalar
<std::string> : std::true_type {};
23
template
<>
struct
is_supported_scalar
<bool> : std::true_type {};
24
25
template
<
typename
T,
size_t
Depth>
26
struct
is_supported_impl
:
is_supported_scalar
<T> {};
27
28
template
<
typename
T,
typename
Alloc,
size_t
Depth>
29
struct
is_supported_impl
<std::vector<T, Alloc>, Depth>
30
: std::conditional_t<
31
(Depth < 2),
32
is_supported_impl<T, Depth + 1>,
33
std::false_type
34
> {};
35
36
template <typename T>
37
struct is_supported : is_supported_impl<T, 0> {};
38
39
}
// namespace sparta::extensions
sparta::extensions::is_supported_impl
Definition
TreeNodeExtensionsSupport.hpp:26
sparta::extensions::is_supported_scalar
Definition
TreeNodeExtensionsSupport.hpp:11
sparta
simulation
TreeNodeExtensionsSupport.hpp
Generated on Fri Jan 30 2026 18:56:21 for The Sparta Modeling Framework by
1.12.0