PMDK C++ bindings  1.12.1-rc1
This is the C++ bindings documentation for PMDK's libpmemobj.
variadic.hpp
Go to the documentation of this file.
1 // SPDX-License-Identifier: BSD-3-Clause
2 /* Copyright 2019, Intel Corporation */
3 
9 #ifndef LIBPMEMOBJ_CPP_VARIADIC_HPP
10 #define LIBPMEMOBJ_CPP_VARIADIC_HPP
11 
12 namespace pmem
13 {
14 
15 namespace detail
16 {
17 
18 /*
19  * Checks if T is the same type as first type in Args.
20  * General case (for sizeof...(Args) == 0).
21  */
22 template <class T, class... Args>
23 struct is_first_arg_same {
24  static constexpr bool value = false;
25 };
26 
27 /*
28  * Checks if T is the same type as first type in Args.
29  * Specialization (for sizeof...(Args) > 0).
30  */
31 template <class T, class FirstArg, class... Args>
32 struct is_first_arg_same<T, FirstArg, Args...> {
33  static constexpr bool value = std::is_same<T, FirstArg>::value;
34 };
35 
36 } /* namespace detail */
37 
38 } /* namespace pmem */
39 
40 #endif /* LIBPMEMOBJ_CPP_VARIADIC_HPP */
pmem
Persistent memory namespace.
Definition: allocation_flag.hpp:15