AutoPas  3.0.0
Loading...
Searching...
No Matches
ContainerConcept.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <array>
10#include <concepts>
11#include <set>
12#include <type_traits>
13#include <vector>
14
15namespace autopas::utils {
16
20namespace is_container_impl {
25template <typename T>
26struct is_container : std::false_type {};
32template <typename T, std::size_t N>
33struct is_container<std::array<T, N>> : std::true_type {};
34
39template <typename... Args>
40struct is_container<std::vector<Args...>> : std::true_type {};
41
46template <typename... Args>
47struct is_container<std::set<Args...>> : std::true_type {};
48
49} // namespace is_container_impl
50
55template <typename T>
56concept ContainerType = is_container_impl::is_container<std::decay_t<T>>::value;
57
58} // namespace autopas::utils
Concept to check if something is a container (vector, array or set).
Definition: ContainerConcept.h:56
In this namespace some helper classes and functions can be found used inside of AutoPas.
Definition: namespaces.h:44
Default case: T is not a container.
Definition: ContainerConcept.h:26