remove stdex::is_detected and stdex::void_t

This commit is contained in:
2019-05-25 02:13:43 +07:00
parent 65e9063ab7
commit b8455bf3ed
2 changed files with 1 additions and 52 deletions

View File

@@ -8,48 +8,6 @@
#include "macros.hpp"
//
// void_t
//
namespace e2d { namespace stdex
{
namespace impl
{
template < typename... Args >
struct make_void {
using type = void;
};
}
template < typename... Args >
using void_t = typename impl::make_void<Args...>::type;
}}
//
// is_detected
//
namespace e2d { namespace stdex
{
namespace impl
{
template < template <typename...> class Op
, typename AlwaysVoid
, typename... Args >
struct is_detected
: std::false_type {};
template < template <typename...> class Op
, typename... Args >
struct is_detected<Op, stdex::void_t<Op<Args...>>, Args...>
: std::true_type {};
}
template < template <typename...> class Op, typename... Args >
using is_detected = typename impl::is_detected<Op, void, Args...>::type;
}}
//
// basic_string_view
//

View File

@@ -118,16 +118,7 @@ namespace e2d { namespace json_utils
namespace e2d { namespace json_utils
{
template < typename T >
using has_try_parse_value = decltype(
try_parse_value(
std::declval<const rapidjson::Value&>(),
std::declval<T&>()));
template < typename T >
std::enable_if_t<
stdex::is_detected<json_utils::has_try_parse_value, T>::value,
bool>
try_parse_value(const rapidjson::Value& root, vector<T>& v) {
bool try_parse_value(const rapidjson::Value& root, vector<T>& v) {
if ( !root.IsArray() ) {
return false;
}