rippled
Loading...
Searching...
No Matches
maybe_const.h
1#ifndef BEAST_UTILITY_MAYBE_CONST_H_INCLUDED
2#define BEAST_UTILITY_MAYBE_CONST_H_INCLUDED
3
4#include <type_traits>
5
6namespace beast {
7
9template <bool IsConst, class T>
11{
12 explicit maybe_const() = default;
13 using type = typename std::conditional<
14 IsConst,
15 typename std::remove_const<T>::type const,
17};
18
20template <bool IsConst, class T>
22
23} // namespace beast
24
25#endif
typename maybe_const< IsConst, T >::type maybe_const_t
Alias for omitting typename.
Definition maybe_const.h:21
Makes T const or non const depending on a bool.
Definition maybe_const.h:11
typename std::conditional< IsConst, typename std::remove_const< T >::type const, typename std::remove_const< T >::type >::type type
Definition maybe_const.h:16
maybe_const()=default