| 1 |
// Range v3 library |
| 2 |
// |
| 3 |
// Copyright Eric Niebler 2013-present |
| 4 |
// |
| 5 |
// Use, modification and distribution is subject to the |
| 6 |
// Boost Software License, Version 1.0. (See accompanying |
| 7 |
// file LICENSE_1_0.txt or copy at |
| 8 |
// http://www.boost.org/LICENSE_1_0.txt) |
| 9 |
// |
| 10 |
// Project home: https://github.com/ericniebler/range-v3 |
| 11 |
// |
| 12 |
|
| 13 |
#ifndef RANGES_V3_UTILITY_STATIC_CONST_HPP |
| 14 |
#define RANGES_V3_UTILITY_STATIC_CONST_HPP |
| 15 |
|
| 16 |
namespace ranges |
| 17 |
{ |
| 18 |
/// \ingroup group-utility |
| 19 |
|
| 20 |
template<typename T> |
| 21 |
struct static_const |
| 22 |
{ |
| 23 |
static constexpr T value{}; |
| 24 |
}; |
| 25 |
|
| 26 |
/// \ingroup group-utility |
| 27 |
/// \sa `static_const` |
| 28 |
template<typename T> |
| 29 |
constexpr T static_const<T>::value; |
| 30 |
} // namespace ranges |
| 31 |
|
| 32 |
#endif |