Expression Templates Library (ETL)
variadic.hpp
Go to the documentation of this file.
1 //=======================================================================
2 // Copyright (c) 2014-2023 Baptiste Wicht
3 // Distributed under the terms of the MIT License.
4 // (See accompanying file LICENSE or copy at
5 // http://opensource.org/licenses/MIT)
6 //=======================================================================
7 
17 #pragma once
18 
19 namespace etl::util {
20 
24 inline size_t size(size_t first) {
25  return first;
26 }
27 
31 template <typename... T>
32 inline size_t size(size_t first, T... args) {
33  return first * size(args...);
34 }
35 
39 template <size_t... I, typename... T>
40 inline size_t size(const std::index_sequence<I...>& /*i*/, const T&... args) {
41  return size((cpp::nth_value<I>(args...))...);
42 }
43 
44 } //end of namespace etl::util
Definition: variadic.hpp:19