tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
contains.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2024 Tobias Hienzsch
3
4#ifndef TETL_MPL_CONTAINS_HPP
5#define TETL_MPL_CONTAINS_HPP
6
7#include <etl/_mpl/list.hpp>
8#include <etl/_type_traits/bool_constant.hpp>
9#include <etl/_type_traits/is_same.hpp>
10
11namespace etl::mpl {
12
13template <typename Needle, typename Haystack>
14struct contains;
15
16template <typename Needle, typename... Ts>
17struct contains<Needle, list<Ts...>> : etl::bool_constant<(etl::is_same_v<Needle, Ts> or ...)> { };
18
19template <typename Needle, typename Haystack>
20inline constexpr auto contains_v = contains<Needle, Haystack>::value;
21
22} // namespace etl::mpl
23
24#endif // TETL_MPL_CONTAINS_HPP
Definition at.hpp:10
constexpr auto contains_v
Definition contains.hpp:20
Definition adjacent_find.hpp:9
Definition list.hpp:11