NetBurner 3.5.8
PDF Version
derived_size.h
1#ifndef __DERIVED_SIZE_H
2#define __DERIVED_SIZE_H
3/*NB_REVISION*/
4
5/*NB_COPYRIGHT*/
6
7
8template <typename T>
9static constexpr T _type_static_max(T a, T b) {
10 return a < b ? b : a;
11}
12
13template <typename T, typename... Ts>
14static constexpr T _type_static_max(T a, Ts... bs) {
15 return _type_static_max(a, static_max(bs...));
16}
17
18template <typename... Ts>
19constexpr size_t _type_max_sizeof() {
20 return _type_static_max(sizeof(Ts)...);
21};
22
23#endif /* ----- #ifndef __DERIVED_SIZE_H ----- */