update boost on linux
This commit is contained in:
@@ -7,60 +7,12 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/fwd/string.hpp>
|
||||
|
||||
#include <boost/mpl/char.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, int N>
|
||||
struct at_c;
|
||||
|
||||
#ifdef BOOST_METAPARSE_VARIADIC_STRING
|
||||
template <char C, char... Cs, int N>
|
||||
struct at_c<string<C, Cs...>, N> : at_c<string<Cs...>, N - 1> {};
|
||||
|
||||
template <char C, char... Cs>
|
||||
struct at_c<string<C, Cs...>, 0> : boost::mpl::char_<C> {};
|
||||
#if BOOST_METAPARSE_STD >= 2011
|
||||
# include <boost/metaparse/v1/cpp11/impl/at_c.hpp>
|
||||
#else
|
||||
#ifdef BOOST_METAPARSE_STRING_CASE
|
||||
# error BOOST_METAPARSE_STRING_CASE is already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_STRING_CASE(z, n, unused) \
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C) \
|
||||
> \
|
||||
struct \
|
||||
at_c< \
|
||||
string< \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C) \
|
||||
>, \
|
||||
n \
|
||||
> : \
|
||||
boost::mpl::char_<BOOST_PP_CAT(C, n)> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_STRING_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_STRING_CASE
|
||||
# include <boost/metaparse/v1/cpp98/impl/at_c.hpp>
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_CONCAT_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_CONCAT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/fwd/string.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/arithmetic/mul.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class A, class B>
|
||||
struct concat;
|
||||
|
||||
#ifdef BOOST_METAPARSE_VARIADIC_STRING
|
||||
template <char... As, char... Bs>
|
||||
struct concat<string<As...>, string<Bs...>> : string<As..., Bs...> {};
|
||||
#else
|
||||
template <class A, class B>
|
||||
struct concat_impl;
|
||||
|
||||
#ifdef BOOST_METAPARSE_ARG
|
||||
# error BOOST_METAPARSE_ARG already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_ARG(z, n, unused) \
|
||||
BOOST_PP_CAT(B, BOOST_PP_INC(n))
|
||||
|
||||
#ifdef BOOST_METAPARSE_CONCAT
|
||||
# error BOOST_METAPARSE_CONCAT already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_CONCAT(z, n, unused) \
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS(n, int A) BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int B) \
|
||||
> \
|
||||
struct \
|
||||
concat_impl< \
|
||||
string< \
|
||||
BOOST_PP_ENUM_PARAMS(n, A) \
|
||||
BOOST_PP_COMMA_IF( \
|
||||
BOOST_PP_MUL( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_STRING_SIZE, n), \
|
||||
n \
|
||||
) \
|
||||
) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_STRING_SIZE, n), \
|
||||
BOOST_NO_CHAR BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
>, \
|
||||
string< \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, B) \
|
||||
> \
|
||||
> : \
|
||||
concat< \
|
||||
string<BOOST_PP_ENUM_PARAMS(n, A) BOOST_PP_COMMA_IF(n) B0>, \
|
||||
string< \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_STRING_SIZE), \
|
||||
BOOST_METAPARSE_ARG, \
|
||||
~ \
|
||||
) \
|
||||
> \
|
||||
> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_CONCAT,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_ARG
|
||||
#undef BOOST_METAPARSE_CONCAT
|
||||
|
||||
template <class S>
|
||||
struct concat<S, string<> > : S {};
|
||||
|
||||
template <class A, class B>
|
||||
struct concat : concat_impl<A, B> {};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_EMPTY_STRING_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_EMPTY_STRING_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class Ignore = int>
|
||||
struct empty_string
|
||||
{
|
||||
typedef empty_string type;
|
||||
|
||||
#ifdef BOOST_NO_CONSTEXPR_C_STR
|
||||
static const char value[1];
|
||||
#else
|
||||
static constexpr char value[1] = {0};
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef BOOST_NO_CONSTEXPR_C_STR
|
||||
template <class Ignore>
|
||||
const char empty_string<Ignore>::value[1] = {0};
|
||||
#else
|
||||
template <class Ignore>
|
||||
constexpr char empty_string<Ignore>::value[1];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_NTH_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_NTH_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/v1/impl/nth_of_c_impl.hpp>
|
||||
#include <boost/metaparse/v1/error/index_out_of_range.hpp>
|
||||
#include <boost/metaparse/v1/fail.hpp>
|
||||
#include <boost/metaparse/limit_sequence_size.hpp>
|
||||
|
||||
#include <boost/mpl/list.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
#ifdef BOOST_METAPARSE_NTH_OF_CASE
|
||||
# error BOOST_METAPARSE_NTH_OF_CASE already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_NTH_OF_CASE(z, n, unused) \
|
||||
template < \
|
||||
int K BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM_PARAMS(n, class P) \
|
||||
> \
|
||||
struct BOOST_PP_CAT(nth_of_c, n) : \
|
||||
boost::mpl::if_< \
|
||||
boost::mpl::bool_<(0 <= K && K < n)>, \
|
||||
nth_of_c_impl< \
|
||||
K, \
|
||||
boost::mpl::list<BOOST_PP_ENUM_PARAMS(n, P)> \
|
||||
>, \
|
||||
fail<error::index_out_of_range<0, n - 1, K> > \
|
||||
>::type \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
BOOST_METAPARSE_NTH_OF_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_NTH_OF_CASE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_NTH_OF_C_IMPL_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_NTH_OF_C_IMPL_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/v1/impl/skip_seq.hpp>
|
||||
|
||||
#include <boost/mpl/front.hpp>
|
||||
#include <boost/mpl/pop_front.hpp>
|
||||
#include <boost/mpl/fold.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <int N, class Seq>
|
||||
struct nth_of_c_impl
|
||||
{
|
||||
private:
|
||||
template <class NextResult>
|
||||
struct apply_unchecked :
|
||||
nth_of_c_impl<
|
||||
N - 1,
|
||||
typename boost::mpl::pop_front<Seq>::type
|
||||
>::template apply<
|
||||
typename get_remaining<NextResult>::type,
|
||||
typename get_position<NextResult>::type
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef nth_of_c_impl type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<
|
||||
typename boost::mpl::front<Seq>::type::template apply<S, Pos>
|
||||
>::type,
|
||||
typename boost::mpl::front<Seq>::type::template apply<S, Pos>,
|
||||
apply_unchecked<
|
||||
typename boost::mpl::front<Seq>::type::template apply<S, Pos>
|
||||
>
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
template <class Seq>
|
||||
struct nth_of_c_impl<0, Seq>
|
||||
{
|
||||
typedef nth_of_c_impl type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::fold<
|
||||
typename boost::mpl::pop_front<Seq>::type,
|
||||
typename boost::mpl::front<Seq>::type::template apply<
|
||||
S,
|
||||
Pos
|
||||
>::type,
|
||||
skip_seq
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_POP_BACK_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_POP_BACK_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/impl/push_front_c.hpp>
|
||||
#include <boost/metaparse/v1/impl/size.hpp>
|
||||
#include <boost/metaparse/v1/impl/update_c.hpp>
|
||||
|
||||
#include <boost/mpl/clear.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct pop_back;
|
||||
|
||||
#ifdef BOOST_METAPARSE_VARIADIC_STRING
|
||||
template <char C>
|
||||
struct pop_back<string<C>> : boost::mpl::clear<string<C>> {};
|
||||
|
||||
template <char C, char... Cs>
|
||||
struct pop_back<string<C, Cs...>> :
|
||||
push_front_c<typename pop_back<string<Cs...>>::type, C>
|
||||
{};
|
||||
#else
|
||||
template <class S>
|
||||
struct pop_back :
|
||||
update_c<
|
||||
typename S::type,
|
||||
size<typename S::type>::type::value - 1,
|
||||
BOOST_NO_CHAR
|
||||
>
|
||||
{};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_POP_FRONT_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_POP_FRONT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/fwd/string.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct pop_front;
|
||||
|
||||
#ifdef BOOST_METAPARSE_VARIADIC_STRING
|
||||
template <char C, char... Cs>
|
||||
struct pop_front<string<C, Cs...>> : string<Cs...> {};
|
||||
#else
|
||||
#ifdef BOOST_METAPARSE_POP_FRONT
|
||||
# error BOOST_METAPARSE_POP_FRONT already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_POP_FRONT(z, n, unused) \
|
||||
BOOST_PP_COMMA_IF(BOOST_PP_DEC(n)) BOOST_PP_CAT(C, n)
|
||||
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C) \
|
||||
>
|
||||
struct
|
||||
pop_front<
|
||||
string<BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)>
|
||||
> :
|
||||
string<
|
||||
BOOST_PP_REPEAT_FROM_TO(
|
||||
1,
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_POP_FRONT,
|
||||
~
|
||||
),
|
||||
BOOST_NO_CHAR
|
||||
>
|
||||
{};
|
||||
|
||||
#undef BOOST_METAPARSE_POP_FRONT
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_PUSH_BACK_C_HPP
|
||||
#define BOOST_METAPARSE_V1_PUSH_BACK_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/impl/update_c.hpp>
|
||||
#include <boost/metaparse/v1/impl/size.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, char C>
|
||||
struct push_back_c;
|
||||
|
||||
#ifdef BOOST_METAPARSE_VARIADIC_STRING
|
||||
template <char... Cs, char C>
|
||||
struct push_back_c<string<Cs...>, C> : string<Cs..., C> {};
|
||||
#else
|
||||
template <class S, char C>
|
||||
struct push_back_c :
|
||||
update_c<typename S::type, size<typename S::type>::type::value, C>
|
||||
{};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_PUSH_FRONT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_PUSH_FRONT_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/fwd/string.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, char C>
|
||||
struct push_front_c;
|
||||
|
||||
#ifdef BOOST_METAPARSE_VARIADIC_STRING
|
||||
template <char... Cs, char C>
|
||||
struct push_front_c<string<Cs...>, C> : string<C, Cs...> {};
|
||||
#else
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C),
|
||||
char Ch
|
||||
>
|
||||
struct push_front_c<
|
||||
string<BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)>,
|
||||
Ch
|
||||
> :
|
||||
string<
|
||||
Ch,
|
||||
BOOST_PP_ENUM_PARAMS(
|
||||
BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_STRING_SIZE),
|
||||
C
|
||||
)
|
||||
>
|
||||
{};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_REMOVE_TRAILING_NO_CHARS_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_REMOVE_TRAILING_NO_CHARS_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/string.hpp>
|
||||
#include <boost/metaparse/v1/impl/push_front_c.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct remove_trailing_no_chars : S {};
|
||||
|
||||
#ifdef BOOST_METAPARSE_VARIADIC_STRING
|
||||
// this code assumes that BOOST_NO_CHARs are at the end of the string
|
||||
template <char... Cs>
|
||||
struct remove_trailing_no_chars<string<BOOST_NO_CHAR, Cs...>> :
|
||||
string<>
|
||||
{};
|
||||
|
||||
template <char C, char... Cs>
|
||||
struct remove_trailing_no_chars<string<C, Cs...>> :
|
||||
push_front_c<typename remove_trailing_no_chars<string<Cs...>>::type,C>
|
||||
{};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/*
|
||||
* These specialisations are needed to avoid an internal compiler error
|
||||
* in Visual C++ 12
|
||||
*/
|
||||
template <char C>
|
||||
struct remove_trailing_no_chars<string<C>> : string<C> {};
|
||||
|
||||
template <>
|
||||
struct remove_trailing_no_chars<string<BOOST_NO_CHAR>> : string<> {};
|
||||
|
||||
template <>
|
||||
struct remove_trailing_no_chars<string<>> : string<> {};
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_SIZE_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_SIZE_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/fwd/string.hpp>
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct size;
|
||||
|
||||
#ifdef BOOST_METAPARSE_VARIADIC_STRING
|
||||
template <char... Cs>
|
||||
struct size<string<Cs...>> : boost::mpl::int_<sizeof...(Cs)> {};
|
||||
#else
|
||||
#ifdef BOOST_METAPARSE_STRING_CASE
|
||||
# error BOOST_METAPARSE_STRING_CASE
|
||||
#endif
|
||||
#define BOOST_METAPARSE_STRING_CASE(z, n, unused) \
|
||||
template <BOOST_PP_ENUM_PARAMS(n, int C)> \
|
||||
struct \
|
||||
size< \
|
||||
string< \
|
||||
BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_STRING_SIZE, n), \
|
||||
BOOST_NO_CHAR BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
> \
|
||||
> : \
|
||||
boost::mpl::int_<n> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_STRING_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_STRING_CASE
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_SKIP_SEQ_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_SKIP_SEQ_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/accept.hpp>
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/get_result.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
struct skip_seq
|
||||
{
|
||||
private:
|
||||
template <class ParsingResult, class NewResultValue>
|
||||
struct change_result :
|
||||
accept<
|
||||
NewResultValue,
|
||||
typename get_remaining<ParsingResult>::type,
|
||||
typename get_position<ParsingResult>::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <class Result, class P>
|
||||
struct apply_unchecked :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<
|
||||
typename P::template apply<
|
||||
typename get_remaining<Result>::type,
|
||||
typename get_position<Result>::type
|
||||
>
|
||||
>::type,
|
||||
typename P::template apply<
|
||||
typename get_remaining<Result>::type,
|
||||
typename get_position<Result>::type
|
||||
>,
|
||||
change_result<
|
||||
typename P::template apply<
|
||||
typename get_remaining<Result>::type,
|
||||
typename get_position<Result>::type
|
||||
>,
|
||||
typename get_result<Result>::type
|
||||
>
|
||||
>
|
||||
{};
|
||||
|
||||
public:
|
||||
template <class Result, class P>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
is_error<Result>,
|
||||
Result,
|
||||
apply_unchecked<Result, P>
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_SPLIT_AT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_SPLIT_AT_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/impl/push_front_c.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/add.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
|
||||
#include <boost/mpl/pair.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <int N, class S>
|
||||
struct split_at_c;
|
||||
|
||||
#ifdef BOOST_METAPARSE_VARIADIC_STRING
|
||||
template <int N, char C, char... Cs>
|
||||
struct split_at_c<N, string<C, Cs...>> :
|
||||
boost::mpl::pair<
|
||||
typename push_front_c<
|
||||
typename split_at_c<N - 1, string<Cs...>>::type::first,
|
||||
C
|
||||
>::type,
|
||||
typename split_at_c<N - 1, string<Cs...>>::type::second
|
||||
>
|
||||
{};
|
||||
|
||||
template <char C, char... Cs>
|
||||
struct split_at_c<0, string<C, Cs...>> :
|
||||
boost::mpl::pair<string<>, string<C, Cs...>>
|
||||
{};
|
||||
|
||||
template <class S>
|
||||
struct split_at_c<0, S> : boost::mpl::pair<string<>, S> {};
|
||||
#else
|
||||
#ifdef BOOST_METAPARSE_ARG
|
||||
# error BOOST_METAPARSE_ARG already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_ARG(z, n, d) BOOST_PP_CAT(C, BOOST_PP_ADD(n, d))
|
||||
|
||||
#ifdef BOOST_METAPARSE_SPLIT_AT
|
||||
# error BOOST_METAPARSE_SPLIT_AT already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_SPLIT_AT(z, n, unused) \
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C) \
|
||||
> \
|
||||
struct \
|
||||
split_at_c< \
|
||||
n, \
|
||||
string<BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE, C) \
|
||||
> \
|
||||
> : \
|
||||
boost::mpl::pair< \
|
||||
string<BOOST_PP_ENUM_PARAMS(n, C)>, \
|
||||
string< \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_STRING_SIZE, n), \
|
||||
BOOST_METAPARSE_ARG, \
|
||||
n \
|
||||
) \
|
||||
> \
|
||||
> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_SPLIT_AT,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_SPLIT_AT
|
||||
#undef BOOST_METAPARSE_ARG
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,41 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_STRING_AT_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_STRING_AT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2016.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/metaparse/v1/impl/no_char.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <int MaxLen, int Len, class T>
|
||||
BOOST_CONSTEXPR int string_at(const T (&s)[Len], int n)
|
||||
{
|
||||
// "MaxLen + 1" adds the \0 character of the string literal to the
|
||||
// limit
|
||||
BOOST_STATIC_ASSERT((Len <= MaxLen + 1));
|
||||
return n >= Len - 1 ? BOOST_NO_CHAR : s[n];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BOOST_METAPARSE_V1_STRING_AT
|
||||
# error BOOST_METAPARSE_V1_STRING_AT already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_V1_STRING_AT \
|
||||
::boost::metaparse::v1::impl::string_at<BOOST_METAPARSE_LIMIT_STRING_SIZE>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_UPDATE_C_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_UPDATE_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
#include <boost/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/impl/split_at_c.hpp>
|
||||
#include <boost/metaparse/v1/impl/concat.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
#ifndef BOOST_METAPARSE_VARIADIC_STRING
|
||||
template <class S, int N, int C>
|
||||
struct update_c;
|
||||
|
||||
#ifdef BOOST_METAPARSE_ARGN
|
||||
# error BOOST_METAPARSE_ARGN already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_ARGN(z, n, unused) , BOOST_PP_CAT(C, n)
|
||||
|
||||
#ifdef BOOST_METAPARSE_UPDATE
|
||||
# error BOOST_METAPARSE_UPDATE already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_UPDATE(z, n, unused) \
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C), \
|
||||
int Ch \
|
||||
> \
|
||||
struct update_c< \
|
||||
string<BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)>,\
|
||||
n, \
|
||||
Ch \
|
||||
> : \
|
||||
string< \
|
||||
BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) \
|
||||
Ch \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
BOOST_PP_INC(n), \
|
||||
BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_STRING_SIZE), \
|
||||
BOOST_METAPARSE_ARGN, \
|
||||
~ \
|
||||
) \
|
||||
> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_UPDATE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_UPDATE
|
||||
#undef BOOST_METAPARSE_ARGN
|
||||
#else
|
||||
template <class S, int N, char C>
|
||||
struct update_c :
|
||||
concat<
|
||||
typename split_at_c<N, S>::type::first,
|
||||
typename
|
||||
update_c<typename split_at_c<N, S>::type::second, 0, C>::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <char... Cs, char C, char NewChar>
|
||||
struct update_c<string<C, Cs...>, 0, NewChar> :
|
||||
string<NewChar, Cs...>
|
||||
{};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user