Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions include/clipp.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
#include <iterator>
#include <functional>

#ifdef _MSVC_LANG
#define CLIPP_CPLUSPLUS _MSVC_LANG
#else
#define CLIPP_CPLUSPLUS __cplusplus
#endif

/*************************************************************************//**
*
Expand Down Expand Up @@ -160,7 +165,14 @@ constexpr auto
check_is_callable(int) -> decltype(
std::declval<Fn>()(std::declval<Args>()...),
std::integral_constant<bool,
std::is_same<Ret,typename std::result_of<Fn(Args...)>::type>::value>{} );
std::is_same<Ret,
#if CLIPP_CPLUSPLUS >= 201703L
typename std::invoke_result_t<Fn, Args...>
#else
typename std::result_of<Fn(Args...)>::type
#endif
>::value>{} );


template<class,class,class...>
constexpr auto
Expand All @@ -171,7 +183,13 @@ constexpr auto
check_is_callable_without_arg(int) -> decltype(
std::declval<Fn>()(),
std::integral_constant<bool,
std::is_same<Ret,typename std::result_of<Fn()>::type>::value>{} );
std::is_same<Ret,
#if CLIPP_CPLUSPLUS >= 201703L
typename std::invoke_result_t<Fn>
#else
typename std::result_of<Fn()>::type
#endif
>::value>{} );

template<class,class>
constexpr auto
Expand Down