2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00

X3: Refactor detectors from disable_if_substitution_failure to just a cast to void

I had to do that to workaround some bug in vs2015 in one detector and have decided to refactor others too.
This commit is contained in:
Nikita Kniazev
2022-01-13 18:57:15 +03:00
parent 5498bc0fd1
commit 31659b5062
3 changed files with 6 additions and 11 deletions

View File

@@ -17,7 +17,6 @@
#include <boost/spirit/home/x3/support/unused.hpp>
#include <boost/spirit/home/x3/support/context.hpp>
#include <boost/spirit/home/x3/support/traits/has_attribute.hpp>
#include <boost/spirit/home/x3/support/utility/sfinae.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/assert.hpp>
#include <string>

View File

@@ -12,7 +12,6 @@
#include <boost/spirit/home/x3/core/parser.hpp>
#include <boost/spirit/home/x3/core/skip_over.hpp>
#include <boost/spirit/home/x3/directive/expect.hpp>
#include <boost/spirit/home/x3/support/utility/sfinae.hpp>
#include <boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp>
#include <boost/utility/addressof.hpp>
@@ -98,15 +97,14 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
template <typename ID, typename Iterator, typename Context>
struct has_on_error<ID, Iterator, Context,
typename disable_if_substitution_failure<
decltype(
decltype(void(
std::declval<ID>().on_error(
std::declval<Iterator&>()
, std::declval<Iterator>()
, std::declval<expectation_failure<Iterator>>()
, std::declval<Context>()
)
)>::type
))
>
: mpl::true_
{};
@@ -116,15 +114,14 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
template <typename ID, typename Iterator, typename Attribute, typename Context>
struct has_on_success<ID, Iterator, Context, Attribute,
typename disable_if_substitution_failure<
decltype(
decltype(void(
std::declval<ID>().on_success(
std::declval<Iterator&>()
, std::declval<Iterator>()
, std::declval<Attribute&>()
, std::declval<Context>()
)
)>::type
))
>
: mpl::true_
{};

View File

@@ -8,7 +8,6 @@
#define BOOST_SPIRIT_X3_IS_CALLABLE_HPP_INCLUDED
#include <boost/mpl/bool.hpp>
#include <boost/spirit/home/x3/support/utility/sfinae.hpp>
namespace boost { namespace spirit { namespace x3 { namespace detail
{
@@ -16,8 +15,8 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
struct is_callable_impl : mpl::false_ {};
template <typename F, typename... A>
struct is_callable_impl<F(A...), typename disable_if_substitution_failure<
decltype(std::declval<F>()(std::declval<A>()...))>::type>
struct is_callable_impl<F(A...),
decltype(void(std::declval<F>()(std::declval<A>()...)))>
: mpl::true_
{};
}}}}