diff --git a/include/turtle/constraints.hpp b/include/turtle/constraints.hpp index 0c679b7..af18b65 100644 --- a/include/turtle/constraints.hpp +++ b/include/turtle/constraints.hpp @@ -13,8 +13,8 @@ #include "constraint.hpp" #include "detail/move_helper.hpp" #include "unwrap_reference.hpp" +#include "detail/void_t.hpp" #include -#include #if BOOST_VERSION >= 107000 #include #else @@ -118,7 +118,7 @@ namespace detail {}; template - struct has_equal_to() == std::declval())>>: std::true_type + struct has_equal_to() == std::declval())>>: std::true_type {}; template< typename Expected > diff --git a/include/turtle/detail/is_functor.hpp b/include/turtle/detail/is_functor.hpp index 0b8f53a..066cb92 100644 --- a/include/turtle/detail/is_functor.hpp +++ b/include/turtle/detail/is_functor.hpp @@ -10,7 +10,7 @@ #define MOCK_IS_FUNCTOR_HPP_INCLUDED #include "../config.hpp" -#include +#include "void_t.hpp" #include namespace mock @@ -22,7 +22,7 @@ namespace detail struct is_functor : std::false_type {}; template< typename F, typename Arg > - struct is_functor< F, Arg, boost::void_t()( std::declval() ) )> >: std::true_type + struct is_functor< F, Arg, void_t()( std::declval() ) )> >: std::true_type {}; } } // mock diff --git a/include/turtle/detail/void_t.hpp b/include/turtle/detail/void_t.hpp new file mode 100644 index 0000000..4c45e04 --- /dev/null +++ b/include/turtle/detail/void_t.hpp @@ -0,0 +1,27 @@ +// http://turtle.sourceforge.net +// +// Copyright Alexander Grund 2020 +// +// 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 MOCK_VOID_T_HPP_INCLUDED +#define MOCK_VOID_T_HPP_INCLUDED + +namespace mock +{ +namespace detail +{ + template + struct make_void + { + using type = void; + }; + /// Standard helper to implement the detection idiom. Returns always void + template + using void_t = typename make_void::type; +} +} // mock + +#endif // MOCK_VOID_T_HPP_INCLUDED