mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-06 23:47:51 +00:00
Added thirdparty: boost library
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_FIRST_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_FIRST_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/nth_of_c.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/fail.hpp>
|
||||
#include <boost/metaparse/v1/error/index_out_of_range.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
struct first_of
|
||||
{
|
||||
typedef first_of type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply : impl::nth_of_c<0, S, Pos, Ps...> {};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct first_of<> : fail<error::index_out_of_range<0, -1, 0>> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_FWD_STRING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_FWD_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)
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <char... Cs>
|
||||
struct string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_ANY_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_ANY_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/or_c.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <char... Cs>
|
||||
struct any_of_c
|
||||
{
|
||||
typedef any_of_c type;
|
||||
|
||||
template <class Chr>
|
||||
struct apply : or_c<(Chr::type::value == Cs)...> {};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_AT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_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/v1/cpp11/fwd/string.hpp>
|
||||
|
||||
#include <boost/mpl/char.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, int N>
|
||||
struct at_c;
|
||||
|
||||
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> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_CONCAT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/v1/cpp11/fwd/string.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class A, class B>
|
||||
struct concat;
|
||||
|
||||
template <char... As, char... Bs>
|
||||
struct concat<string<As...>, string<Bs...>> : string<As..., Bs...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_EMPTY_STRING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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)
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class Ignore = int>
|
||||
struct empty_string
|
||||
{
|
||||
typedef empty_string type;
|
||||
|
||||
static constexpr char value[1] = {0};
|
||||
};
|
||||
|
||||
template <class Ignore>
|
||||
constexpr char empty_string<Ignore>::value[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_EVAL_LATER_RESULT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_EVAL_LATER_RESULT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/get_position.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/less.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class R1, class R2>
|
||||
struct eval_later_result :
|
||||
boost::mpl::eval_if<
|
||||
typename boost::mpl::less<
|
||||
typename get_position<R2>::type,
|
||||
typename get_position<R1>::type
|
||||
>::type,
|
||||
R1,
|
||||
R2
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/is_none_c_impl.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <char... Cs>
|
||||
struct is_none_c
|
||||
{
|
||||
typedef is_none_c type;
|
||||
|
||||
template <class C>
|
||||
struct apply : is_none_c_impl<C::type::value, Cs...> {};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_IMPL_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_IMPL_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/mpl/bool.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <char D, char... Cs>
|
||||
struct is_none_c_impl;
|
||||
|
||||
template <char D>
|
||||
struct is_none_c_impl<D> : boost::mpl::bool_<true> {};
|
||||
|
||||
template <char D, char... Cs>
|
||||
struct is_none_c_impl<D, D, Cs...> : boost::mpl::bool_<false> {};
|
||||
|
||||
template <char D, char C, char... Cs>
|
||||
struct is_none_c_impl<D, C, Cs...> : is_none_c_impl<D, Cs...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/nth_of_c_skip_remaining.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/get_result.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <int N, class S, class Pos, class... Ps>
|
||||
struct nth_of_c;
|
||||
|
||||
template <int N, class S, class Pos, class P, class... Ps>
|
||||
struct nth_of_c<N, S, Pos, P, Ps...>
|
||||
{
|
||||
private:
|
||||
template <class NextResult>
|
||||
struct apply_unchecked :
|
||||
nth_of_c<
|
||||
N - 1,
|
||||
typename get_remaining<NextResult>::type,
|
||||
typename get_position<NextResult>::type,
|
||||
Ps...
|
||||
>
|
||||
{};
|
||||
|
||||
public:
|
||||
typedef
|
||||
typename std::conditional<
|
||||
is_error<typename P::template apply<S, Pos>>::type::value,
|
||||
typename P::template apply<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos>>
|
||||
>::type::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <class P, class S, class Pos, class... Ps>
|
||||
struct nth_of_c<0, S, Pos, P, Ps...>
|
||||
{
|
||||
private:
|
||||
template <class NextResult>
|
||||
struct apply_unchecked :
|
||||
nth_of_c_skip_remaining<
|
||||
typename get_result<NextResult>::type,
|
||||
typename get_remaining<NextResult>::type,
|
||||
typename get_position<NextResult>::type,
|
||||
Ps...
|
||||
>
|
||||
{};
|
||||
|
||||
public:
|
||||
typedef
|
||||
typename std::conditional<
|
||||
is_error<typename P::template apply<S, Pos>>::type::value,
|
||||
typename P::template apply<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos>>
|
||||
>::type::type
|
||||
type;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_SKIP_REMANING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_SKIP_REMANING_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/return_.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class FinalResult, class S, class Pos, class... Ps>
|
||||
struct nth_of_c_skip_remaining;
|
||||
|
||||
template <class FinalResult, class S, class Pos>
|
||||
struct nth_of_c_skip_remaining<FinalResult, S, Pos> :
|
||||
return_<FinalResult>::template apply<S, Pos>
|
||||
{};
|
||||
|
||||
template <class FinalResult, class S, class Pos, class P, class... Ps>
|
||||
struct nth_of_c_skip_remaining<FinalResult, S, Pos, P, Ps...>
|
||||
{
|
||||
private:
|
||||
template <class NextResult>
|
||||
struct apply_unchecked :
|
||||
nth_of_c_skip_remaining<
|
||||
FinalResult,
|
||||
typename get_remaining<NextResult>::type,
|
||||
typename get_position<NextResult>::type,
|
||||
Ps...
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef
|
||||
typename std::conditional<
|
||||
is_error<typename P::template apply<S, Pos>>::type::value,
|
||||
typename P::template apply<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos>>
|
||||
>::type::type
|
||||
type;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_OR_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_OR_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/mpl/bool.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <bool... Bs>
|
||||
struct or_c;
|
||||
|
||||
template <>
|
||||
struct or_c<> : boost::mpl::false_ {};
|
||||
|
||||
template <bool... Bs>
|
||||
struct or_c<true, Bs...> : boost::mpl::true_ {};
|
||||
|
||||
template <bool... Bs>
|
||||
struct or_c<false, Bs...> : or_c<Bs...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_POP_BACK_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/v1/cpp11/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/push_front_c.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/size.hpp>
|
||||
|
||||
#include <boost/mpl/clear.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct pop_back;
|
||||
|
||||
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>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_POP_FRONT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/v1/cpp11/fwd/string.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct pop_front;
|
||||
|
||||
template <char C, char... Cs>
|
||||
struct pop_front<string<C, Cs...>> : string<Cs...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_PUSH_BACK_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_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/v1/cpp11/fwd/string.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, char C>
|
||||
struct push_back_c;
|
||||
|
||||
template <char... Cs, char C>
|
||||
struct push_back_c<string<Cs...>, C> : string<Cs..., C> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_PUSH_FRONT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/v1/cpp11/fwd/string.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, char C>
|
||||
struct push_front_c;
|
||||
|
||||
template <char... Cs, char C>
|
||||
struct push_front_c<string<Cs...>, C> : string<C, Cs...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_PUSH_FRONT_RESULT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_PUSH_FRONT_RESULT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2018.
|
||||
// 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/get_result.hpp>
|
||||
|
||||
#include <boost/mpl/push_front.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class Value>
|
||||
struct push_front_result
|
||||
{
|
||||
typedef push_front_result type;
|
||||
|
||||
template <class Seq>
|
||||
struct apply :
|
||||
boost::mpl::push_front<Seq, typename get_result<Value>::type>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_SIZE_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/v1/cpp11/fwd/string.hpp>
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct size;
|
||||
|
||||
template <char... Cs>
|
||||
struct size<string<Cs...>> : boost::mpl::int_<sizeof...(Cs)> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+2125
File diff suppressed because one or more lines are too long
+39
@@ -0,0 +1,39 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_STRING_AT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/limit_string_size.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <int MaxLen, int Len, class T>
|
||||
constexpr T string_at(const T (&s)[Len], int n)
|
||||
{
|
||||
// "MaxLen + 1" adds the \0 character of the string literal to the
|
||||
// limit
|
||||
static_assert(Len <= MaxLen + 1, "String literal is too long.");
|
||||
return n >= Len - 1 ? T() : 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
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_LAST_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_LAST_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/nth_of_c.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/fail.hpp>
|
||||
#include <boost/metaparse/v1/error/index_out_of_range.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
struct last_of
|
||||
{
|
||||
typedef last_of type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply : impl::nth_of_c<sizeof...(Ps) - 1, S, Pos, Ps...> {};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct last_of<> : fail<error::index_out_of_range<0, -1, 0>> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_NTH_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_NTH_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/nth_of_c.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class K, class... Ps>
|
||||
struct nth_of : nth_of_c<K::type::value, Ps...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_NTH_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_NTH_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/nth_of_c.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/fail.hpp>
|
||||
#include <boost/metaparse/v1/error/index_out_of_range.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <int N, class... Ps>
|
||||
struct nth_of_c
|
||||
{
|
||||
typedef nth_of_c type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
std::conditional<
|
||||
(0 <= N && N < sizeof...(Ps)),
|
||||
impl::nth_of_c<N, S, Pos, Ps...>,
|
||||
typename fail<error::index_out_of_range<0, sizeof...(Ps) - 1, N>>
|
||||
::template apply<S, Pos>
|
||||
>::type
|
||||
{};
|
||||
};
|
||||
|
||||
template <int N>
|
||||
struct nth_of_c<N> : fail<error::index_out_of_range<0, -1, N>> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/error/unexpected_character.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/is_none_c.hpp>
|
||||
#include <boost/metaparse/v1/one_char.hpp>
|
||||
#include <boost/metaparse/v1/accept_when.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Cs>
|
||||
struct one_char_except :
|
||||
accept_when<
|
||||
one_char,
|
||||
impl::is_none_c<Cs::type::value...>,
|
||||
error::unexpected_character
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/error/unexpected_character.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/is_none_c.hpp>
|
||||
#include <boost/metaparse/v1/accept_when.hpp>
|
||||
#include <boost/metaparse/v1/one_char.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <char... Cs>
|
||||
struct one_char_except_c :
|
||||
accept_when<
|
||||
one_char,
|
||||
impl::is_none_c<Cs...>,
|
||||
error::unexpected_character
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_ONE_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_ONE_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/fail.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/eval_later_result.hpp>
|
||||
#include <boost/metaparse/v1/error/none_of_the_expected_cases_found.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
struct one_of;
|
||||
|
||||
template <class P, class... Ps>
|
||||
struct one_of<P, Ps...>
|
||||
{
|
||||
typedef one_of type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, Pos>>::type,
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<
|
||||
typename one_of<Ps...>::template apply<S, Pos>
|
||||
>::type,
|
||||
impl::eval_later_result<
|
||||
typename P::template apply<S, Pos>,
|
||||
typename one_of<Ps...>::template apply<S, Pos>
|
||||
>,
|
||||
typename one_of<Ps...>::template apply<S, Pos>
|
||||
>,
|
||||
typename P::template apply<S, Pos>
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct one_of<> : fail<error::none_of_the_expected_cases_found> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_ONE_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_ONE_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/one_char.hpp>
|
||||
#include <boost/metaparse/v1/accept_when.hpp>
|
||||
#include <boost/metaparse/v1/error/none_of_the_expected_cases_found.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/any_of_c.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <char... Cs>
|
||||
struct one_of_c :
|
||||
accept_when<
|
||||
one_char,
|
||||
impl::any_of_c<Cs...>,
|
||||
error::none_of_the_expected_cases_found
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/one_of.hpp>
|
||||
#include <boost/metaparse/v1/repeated.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
using repeated_one_of = repeated<one_of<Ps...>>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF1_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF1_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/one_of.hpp>
|
||||
#include <boost/metaparse/v1/repeated1.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
using repeated_one_of1 = repeated1<one_of<Ps...>>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_SEQUENCE_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_SEQUENCE_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2018.
|
||||
// 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/cpp11/impl/push_front_result.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/return_.hpp>
|
||||
#include <boost/metaparse/v1/transform.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/vector.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
struct sequence;
|
||||
|
||||
template <>
|
||||
struct sequence<> : return_<boost::mpl::vector<>> {};
|
||||
|
||||
template <class P, class... Ps>
|
||||
struct sequence<P, Ps...>
|
||||
{
|
||||
private:
|
||||
template <class Res>
|
||||
struct apply_unchecked :
|
||||
transform<
|
||||
sequence<Ps...>,
|
||||
impl::push_front_result<Res>
|
||||
>::template apply<
|
||||
typename get_remaining<Res>::type,
|
||||
typename get_position<Res>::type
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef sequence type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, Pos>>::type,
|
||||
typename P::template apply<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos>>
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_STRING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_STRING_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2012.
|
||||
// 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/cpp11/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/string_tag.hpp>
|
||||
#include <boost/metaparse/v1/impl/string_iterator.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/empty_string.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/size.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/pop_front.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/push_front_c.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/push_back_c.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/pop_back.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/string_at.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
/*
|
||||
* The string type
|
||||
*/
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <char... Cs>
|
||||
struct string
|
||||
{
|
||||
typedef string type;
|
||||
typedef string_tag tag;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Boost.MPL overloads
|
||||
*/
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace mpl
|
||||
{
|
||||
// push_back
|
||||
template <class S>
|
||||
struct push_back_impl;
|
||||
|
||||
template <>
|
||||
struct push_back_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef push_back_impl type;
|
||||
|
||||
template <class S, class C>
|
||||
struct apply :
|
||||
boost::metaparse::v1::impl::push_back_c<
|
||||
typename S::type,
|
||||
C::type::value
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
// pop_back
|
||||
template <class S>
|
||||
struct pop_back_impl;
|
||||
|
||||
template <>
|
||||
struct pop_back_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef pop_back_impl type;
|
||||
|
||||
template <class S>
|
||||
struct apply : boost::metaparse::v1::impl::pop_back<S> {};
|
||||
};
|
||||
|
||||
// push_front
|
||||
template <class S>
|
||||
struct push_front_impl;
|
||||
|
||||
template <>
|
||||
struct push_front_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef push_front_impl type;
|
||||
|
||||
template <class S, class C>
|
||||
struct apply :
|
||||
boost::metaparse::v1::impl::push_front_c<
|
||||
typename S::type,
|
||||
C::type::value
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
// pop_front
|
||||
template <class S>
|
||||
struct pop_front_impl;
|
||||
|
||||
template <>
|
||||
struct pop_front_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef pop_front_impl type;
|
||||
|
||||
template <class S>
|
||||
struct apply : boost::metaparse::v1::impl::pop_front<S> {};
|
||||
};
|
||||
|
||||
// clear
|
||||
template <class S>
|
||||
struct clear_impl;
|
||||
|
||||
template <>
|
||||
struct clear_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef clear_impl type;
|
||||
|
||||
template <class S>
|
||||
struct apply : boost::metaparse::v1::string<> {};
|
||||
};
|
||||
|
||||
// begin
|
||||
template <class S>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef begin_impl type;
|
||||
|
||||
template <class S>
|
||||
struct apply :
|
||||
boost::metaparse::v1::impl::string_iterator<typename S::type, 0>
|
||||
{};
|
||||
};
|
||||
|
||||
// end
|
||||
template <class S>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef end_impl type;
|
||||
|
||||
template <class S>
|
||||
struct apply :
|
||||
boost::metaparse::v1::impl::string_iterator<
|
||||
typename S::type,
|
||||
boost::metaparse::v1::impl::size<typename S::type>::type::value
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
// equal_to
|
||||
template <class A, class B>
|
||||
struct equal_to_impl;
|
||||
|
||||
template <>
|
||||
struct equal_to_impl<
|
||||
boost::metaparse::v1::string_tag,
|
||||
boost::metaparse::v1::string_tag
|
||||
>
|
||||
{
|
||||
typedef equal_to_impl type;
|
||||
|
||||
template <class A, class B>
|
||||
struct apply : std::is_same<typename A::type, typename B::type> {};
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct equal_to_impl<boost::metaparse::v1::string_tag, T>
|
||||
{
|
||||
typedef equal_to_impl type;
|
||||
|
||||
template <class, class>
|
||||
struct apply : false_ {};
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct equal_to_impl<T, boost::metaparse::v1::string_tag> :
|
||||
equal_to_impl<boost::metaparse::v1::string_tag, T>
|
||||
{};
|
||||
|
||||
// c_str
|
||||
template <class S>
|
||||
struct c_str;
|
||||
|
||||
template <char... Cs>
|
||||
struct c_str<boost::metaparse::v1::string<Cs...>>
|
||||
{
|
||||
typedef c_str type;
|
||||
static constexpr char value[sizeof...(Cs) + 1] = {Cs..., 0};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct c_str<boost::metaparse::v1::string<>> :
|
||||
boost::metaparse::v1::impl::empty_string<>
|
||||
{};
|
||||
|
||||
template <char... Cs>
|
||||
constexpr char c_str<boost::metaparse::v1::string<Cs...>>::value[];
|
||||
}
|
||||
}
|
||||
|
||||
#if __clang__
|
||||
# if __has_extension(cxx_string_literal_templates)
|
||||
# define BOOST_METAPARSE_V1_STRING(...) ::boost::metaparse::string<__VA_ARGS__>
|
||||
# else
|
||||
# include <boost/metaparse/v1/cpp11/impl/string.hpp>
|
||||
# endif
|
||||
#else
|
||||
# include <boost/metaparse/v1/cpp11/impl/string.hpp>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user