DryChem
1.0.0
A generic, compile-time C++ toolbox with no dependencies for the modern computational chemistry project.
Loading...
Searching...
No Matches
isAssociativeContainer.hpp
Go to the documentation of this file.
1
// Copyright (c) 2020-2025 Cody R. Drisko. All rights reserved.
2
// Licensed under the MIT License. See the LICENSE file in the project root for more information.
3
//
4
// Name: isAssociativeContainer.hpp
5
// Author: crdrisko
6
// Date: 09/23/2020-07:42:36
7
// Description: A type trait for determining whether a type T meets the requirements of an associative container
8
9
#ifndef DRYCHEM_COMMON_UTILITIES_INCLUDE_COMMON_UTILS_META_TRAITS_CONTAINERTRAITS_ISASSOCIATIVECONTAINER_HPP
10
#define DRYCHEM_COMMON_UTILITIES_INCLUDE_COMMON_UTILS_META_TRAITS_CONTAINERTRAITS_ISASSOCIATIVECONTAINER_HPP
11
12
#include <type_traits>
13
#include <utility>
14
15
#include "
common-utils/meta/traits/containerTraits/isContainer.hpp
"
16
17
namespace
CppUtils::Meta
18
{
25
template
<
typename
,
typename
= std::
void
_t<>>
26
struct
is_associative_container
: std::false_type
27
{
28
};
29
36
template
<
typename
T>
37
struct
is_associative_container
<T, std::void_t<typename T::key_type,
38
typename T::key_compare,
39
typename T::value_compare,
40
decltype(std::declval<T>().key_comp()),
41
decltype(std::declval<T>().value_comp())>> :
is_container
<T>
42
{
43
};
44
46
template
<
typename
T>
47
constexpr
bool
is_associative_container_v
=
is_associative_container<T>::value
;
48
}
// namespace CppUtils::Meta
49
50
#endif
isContainer.hpp
CppUtils::Meta
Definition
frontList.hpp:13
CppUtils::Meta::is_associative_container_v
constexpr bool is_associative_container_v
Convenience variable template for ease-of-use.
Definition
isAssociativeContainer.hpp:47
CppUtils::Meta::is_associative_container
Definition
isAssociativeContainer.hpp:27
CppUtils::Meta::is_container
Definition
isContainer.hpp:25
common-utilities
include
common-utils
meta
traits
containerTraits
isAssociativeContainer.hpp
Generated on Thu Feb 13 2025 11:55:13 for DryChem by
1.13.2