RhythmGame 1.4.3
Loading...
Searching...
No Matches
TupleSize.h
Go to the documentation of this file.
1//
2// Created by bobini on 14.06.23.
3//
4
5#ifndef RHYTHMGAME_TUPLESIZE_H
6#define RHYTHMGAME_TUPLESIZE_H
7
8#include <boost/pfr/tuple_size.hpp>
9#include <tuple>
10namespace support {
11
16template<typename T>
17 requires requires {
18 {
19 std::tuple_size<T>::value
20 };
21 } || std::is_aggregate_v<T>
23{
24 static constexpr auto tupleSizeImpl() -> std::size_t
25 {
26 if constexpr (requires {
27 {
28 std::tuple_size<T>::value
29 };
30 }) {
31 return std::tuple_size<T>::value;
32 } else {
33 return boost::pfr::tuple_size<T>::value;
34 }
35 }
36public:
37 static constexpr auto
38 value = tupleSizeImpl();
39};
40
41template<typename T>
43
44} // namespace support
45
46#endif // RHYTHMGAME_TUPLESIZE_H
Used to get the size of a tuple or an aggregate.
Definition TupleSize.h:23
static constexpr auto value
Definition TupleSize.h:38
Contains various helper classes and functions.
Definition Capitalize.h:9
constexpr auto tupleSizeV
Definition TupleSize.h:42