DryChem 1.0.0
A generic, compile-time C++ toolbox with no dependencies for the modern computational chemistry project.
Loading...
Searching...
No Matches
isReversibleContainer.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: isReversibleContainer.hpp
5// Author: crdrisko
6// Date: 09/23/2020-07:41:46
7// Description: A type trait for determining whether a type T meets the requirements of a reversible container
8
9#ifndef DRYCHEM_COMMON_UTILITIES_INCLUDE_COMMON_UTILS_META_TRAITS_CONTAINERTRAITS_ISREVERSIBLECONTAINER_HPP
10#define DRYCHEM_COMMON_UTILITIES_INCLUDE_COMMON_UTILS_META_TRAITS_CONTAINERTRAITS_ISREVERSIBLECONTAINER_HPP
11
12#include <type_traits>
13#include <utility>
14
16
17namespace CppUtils::Meta
18{
25 template<typename, typename = std::void_t<>>
26 struct is_reversible_container : std::false_type
27 {
28 };
29
36 template<typename T>
37 struct is_reversible_container<T, std::void_t<typename T::reverse_iterator,
38 typename T::const_reverse_iterator,
39 decltype(std::declval<T>().rbegin()),
40 decltype(std::declval<T>().rend()),
41 decltype(std::declval<T>().crbegin()),
42 decltype(std::declval<T>().crend())>> : is_container<T>
43 {
44 };
45
47 template<typename T>
49} // namespace CppUtils::Meta
50
51#endif
Definition frontList.hpp:13
constexpr bool is_reversible_container_v
Convenience variable template for ease-of-use.
Definition isReversibleContainer.hpp:48
Definition isContainer.hpp:25
Definition isReversibleContainer.hpp:27