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
11template <bool, typename Type = void>
12struct enable_if { };
13
14template <typename Type>
15struct enable_if<true, Type> {
16 using type = Type;
17};
18
19template <bool B, typename T = void>
20using enable_if_t = typename enable_if<B, T>::type;
21
22} // namespace etl
23
24#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:12