forked from boostorg/spirit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework attribute for alternative parser
Implement the following rules * Remove duplicates * Simplify variant<X> to X * Make unused_type the first type of the variant * Transform variant<unused_type, T> to optional<T>
- Loading branch information
Showing
8 changed files
with
228 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/*============================================================================= | ||
Copyright (c) 2020 Nikita Kniazev | ||
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) | ||
=============================================================================*/ | ||
|
||
#ifndef BOOST_SPIRIT_X3_SUPPORT_META | ||
#define BOOST_SPIRIT_X3_SUPPORT_META | ||
|
||
#include <boost/spirit/home/x3/support/unused.hpp> | ||
#include <type_traits> | ||
|
||
namespace boost { namespace spirit { namespace x3 { namespace detail | ||
{ | ||
template <typename... T> | ||
struct type_sequence | ||
{ | ||
using type = type_sequence; | ||
|
||
static const int size = sizeof...(T); | ||
|
||
template <typename... U> | ||
using append = type_sequence<T..., U...>; | ||
|
||
template <typename... U> | ||
using prepend = type_sequence<U..., T...>; | ||
|
||
template <typename U> | ||
using extend = typename U::template prepend<T...>; | ||
|
||
template <template <typename...> class U> | ||
using transfer_to = U<T...>; | ||
|
||
template <typename U> | ||
static constexpr bool contains = (std::is_same_v<U, T> || ...); | ||
}; | ||
|
||
template <bool> | ||
struct conditional_impl | ||
{ | ||
template <typename T, typename> | ||
using type = T; | ||
}; | ||
|
||
template <> | ||
struct conditional_impl<false> | ||
{ | ||
template <typename, typename F> | ||
using type = F; | ||
}; | ||
|
||
template <bool B, typename T, typename F> | ||
using conditional_t = typename conditional_impl<B>::template type<T, F>; | ||
}}}} | ||
|
||
#endif |
62 changes: 0 additions & 62 deletions
62
include/boost/spirit/home/x3/support/traits/attribute_of_binary.hpp
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters