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