cpp-msgpack-light
0.3.0
A light library to serialize MessagePack.
Loading...
Searching...
No Matches
total_size_of.h
Go to the documentation of this file.
1
/*
2
* Copyright 2024 MusicScience37 (Kenta Kabashima)
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
20
#pragma once
21
22
#include <cstddef>
23
24
namespace
msgpack_light::details
{
25
31
template
<
typename
... T>
32
struct
total_size_of_impl
;
33
40
template
<
typename
First,
typename
... Remaining>
41
struct
total_size_of_impl
<First, Remaining...> {
43
static
constexpr
std::size_t
value
=
44
sizeof
(First) +
total_size_of_impl<Remaining...>::value
;
45
};
46
52
template
<
typename
T>
53
struct
total_size_of_impl
<T> {
55
static
constexpr
std::size_t
value
=
sizeof
(T);
56
};
57
63
template
<
typename
... T>
64
constexpr
std::size_t
total_size_of
=
total_size_of_impl
<T...>::value;
65
66
}
// namespace msgpack_light::details
msgpack_light::details
Namespace of internal implementations.
Definition
binary.h:35
msgpack_light::details::total_size_of
constexpr std::size_t total_size_of
Get the total size of types in template arguments.
Definition
total_size_of.h:64
msgpack_light::details::total_size_of_impl< First, Remaining... >::value
static constexpr std::size_t value
Total size.
Definition
total_size_of.h:43
msgpack_light::details::total_size_of_impl< T >::value
static constexpr std::size_t value
Total size.
Definition
total_size_of.h:55
msgpack_light::details::total_size_of_impl
Get the total size of types in template arguments.
Definition
total_size_of.h:32
include
msgpack_light
details
total_size_of.h
Generated on
for cpp-msgpack-light by
1.14.0