2013-08-08 09:54:33 +00:00
|
|
|
/*=============================================================================
|
2019-01-07 08:47:17 +00:00
|
|
|
Copyright (c) 2011-2019 Bolero MURAKAMI
|
2013-08-08 09:54:33 +00:00
|
|
|
https://github.com/bolero-MURAKAMI/Sprout
|
|
|
|
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
=============================================================================*/
|
2016-08-14 07:02:23 +00:00
|
|
|
#ifndef SPROUT_INDEX_TUPLE_LITERALS_HPP
|
|
|
|
#define SPROUT_INDEX_TUPLE_LITERALS_HPP
|
2013-04-07 12:55:55 +00:00
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
|
|
|
#include <sprout/index_tuple/index_tuple.hpp>
|
2016-08-14 07:02:23 +00:00
|
|
|
#include <sprout/detail/udl_namespace.hpp>
|
2013-04-07 12:55:55 +00:00
|
|
|
|
|
|
|
#if SPROUT_USE_USER_DEFINED_LITERALS
|
|
|
|
|
|
|
|
#include <sprout/index_tuple/make_index_tuple.hpp>
|
2013-07-07 10:10:25 +00:00
|
|
|
#include <sprout/detail/digits_to_int.hpp>
|
2013-04-07 12:55:55 +00:00
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
//
|
|
|
|
// indexes_result
|
2013-07-07 10:10:25 +00:00
|
|
|
// uindexes_result
|
2013-04-07 12:55:55 +00:00
|
|
|
//
|
|
|
|
template<char... Chars>
|
|
|
|
struct indexes_result
|
|
|
|
: public sprout::make_index_tuple<sprout::detail::digits_to_int<sprout::index_t, Chars...>::value>
|
|
|
|
{};
|
|
|
|
template<char... Chars>
|
|
|
|
struct uindexes_result
|
|
|
|
: public sprout::make_uindex_tuple<sprout::detail::digits_to_int<sprout::uindex_t, Chars...>::value>
|
|
|
|
{};
|
|
|
|
|
2016-08-14 07:02:23 +00:00
|
|
|
namespace literals {
|
2013-04-14 07:51:19 +00:00
|
|
|
namespace indexes {
|
|
|
|
//
|
|
|
|
// _indexes
|
2013-07-07 10:10:25 +00:00
|
|
|
// _uindexes
|
2013-04-14 07:51:19 +00:00
|
|
|
//
|
|
|
|
template<char... Chars>
|
|
|
|
SPROUT_CONSTEXPR typename sprout::indexes_result<Chars...>::type
|
|
|
|
operator"" _indexes() {
|
|
|
|
return sprout::indexes_result<Chars...>::make();
|
|
|
|
}
|
|
|
|
template<char... Chars>
|
|
|
|
SPROUT_CONSTEXPR typename sprout::uindexes_result<Chars...>::type
|
|
|
|
operator"" _uindexes() {
|
|
|
|
return sprout::uindexes_result<Chars...>::make();
|
|
|
|
}
|
|
|
|
} // namespace indexes
|
|
|
|
|
2016-08-14 07:02:23 +00:00
|
|
|
using sprout::literals::indexes::operator"" _indexes;
|
|
|
|
using sprout::literals::indexes::operator"" _uindexes;
|
|
|
|
} // namespace literals
|
2013-04-07 12:55:55 +00:00
|
|
|
|
2016-08-14 07:02:23 +00:00
|
|
|
using sprout::literals::indexes::operator"" _indexes;
|
|
|
|
using sprout::literals::indexes::operator"" _uindexes;
|
2013-04-07 12:55:55 +00:00
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #if SPROUT_USE_USER_DEFINED_LITERALS
|
|
|
|
|
2016-08-14 07:02:23 +00:00
|
|
|
#endif // #ifndef SPROUT_INDEX_TUPLE_LITERALS_HPP
|