tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
enable_if.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_TYPE_TRAITS_ENABLE_IF_HPP
5#define TETL_TYPE_TRAITS_ENABLE_IF_HPP
6
7namespace etl {
8/// Define a member typedef only if a boolean constant is true.
9///
10/// \include type_traits.cpp
11/// \ingroup type_traits
12template <bool, typename Type = void>
13struct enable_if { };
14
15template <typename Type>
16struct enable_if<true, Type> {
17 using type = Type;
18};
19
20/// \ingroup type_traits
21template <bool B, typename T = void>
22using enable_if_t = typename enable_if<B, T>::type;
23
24} // namespace etl
25
26#endif // TETL_TYPE_TRAITS_ENABLE_IF_HPP
Definition adjacent_find.hpp:9
Define a member typedef only if a boolean constant is true.
Definition enable_if.hpp:13