SST 15.0
Structural Simulation Toolkit
serialize_utility.h
1// Copyright 2009-2025 NTESS. Under the terms
2// of Contract DE-NA0003525 with NTESS, the U.S.
3// Government retains certain rights in this software.
4//
5// Copyright (c) 2009-2025, NTESS
6// All rights reserved.
7//
8// This file is part of the SST software package. For license
9// information, see the LICENSE file in the top level directory of the
10// distribution.
11
12#ifndef SST_CORE_SERIALIZATION_IMPL_SERIALIZE_UTILITY_H
13#define SST_CORE_SERIALIZATION_IMPL_SERIALIZE_UTILITY_H
14
15#ifndef SST_INCLUDING_SERIALIZE_H
16#warning \
17 "The header file sst/core/serialization/impl/serialize_utility.h should not be directly included as it is not part of the stable public API. The file is included in sst/core/serialization/serialize.h"
18#endif
19
20#include <type_traits>
21
22namespace SST::Core::Serialization {
23
24// Whether two names are the same template. Similar to std::is_same_v.
25template <template <typename...> class, template <typename...> class>
26constexpr bool is_same_template_v = false;
27
28template <template <typename...> class T>
29constexpr bool is_same_template_v<T, T> = true;
30
31// Whether a certain type is the same as a certain class template filled with arguments
32template <class, template <typename...> class>
33constexpr bool is_same_type_template_v = false;
34
35template <template <typename...> class T1, typename... T1ARGS, template <typename...> class T2>
36constexpr bool is_same_type_template_v<T1<T1ARGS...>, T2> = is_same_template_v<T1, T2>;
37
38} // namespace SST::Core::Serialization
39
40#endif // SST_CORE_SERIALIZATION_IMPL_SERIALIZE_UTILITY_H