Fix the is_invocable trait implementation
What's needed : monitor the following bug report https://developercommunity.visualstudio.com/content/problem/164024/msvc-fails-to-expand-parameter-pack-in-an-unevalua.html .
(Repro : https://godbolt.org/g/UTMcj6)
Repro code :
#include <type_traits>
namespace details {
// is_function_call
template <typename T, typename ArgList, typename = void>
struct is_function_call_impl : std::false_type {
};
template <typename T, template <class...> class ArgList, typename... Args>
struct is_function_call_impl<T, ArgList<Args...>, std::void_t<decltype(std::declval<T>()(std::declval<Args>()...))>>
: std::true_type {
};
// is_nothrow_function_call
template <typename T, class ArgList, typename Valid = void, typename = void>
struct is_nothrow_function_call_impl : std::false_type {
};
template <typename T, template <class...> class ArgList, typename Valid, typename... Args>
struct is_nothrow_function_call_impl<T, ArgList<Args...>, Valid,
std::enable_if_t<noexcept(std::declval<T>()(std::declval<Args>()...))>>
: is_function_call_impl<T, ArgList<Args...>, Valid> {
};
}
// is_function_call : f(args...)
template <typename T, typename... Args>
using is_function_call = details::is_function_call_impl<T, std::void_t<Args...>>;
template <typename T, typename... Args>
using is_function_call_t = typename is_function_call<T, Args...>::type;
template <typename T, typename... Args>
constexpr bool is_function_call_v = is_function_call<T, Args...>::value;
// is_nothrow_function_call
template <typename T, typename... Args>
using is_nothrow_function_call = details::is_nothrow_function_call_impl<T, std::void_t<Args...>>;
template <typename T, typename... Args>
using is_nothrow_function_call_t = typename is_nothrow_function_call<T, Args...>::type;
template <typename T, typename... Args>
constexpr bool is_nothrow_function_call_v = is_nothrow_function_call<T, Args...>::value;
Once it's fixed remove the msvc switch on :
- https://gitlab.lrde.epita.fr/mroynard/metaprog/blob/dev/include/metaprog/cpt/utility/details/traits_impl.hpp#L782
- https://gitlab.lrde.epita.fr/mroynard/metaprog/blob/dev/include/metaprog/cpt/utility/details/traits_impl.hpp#L801
- https://gitlab.lrde.epita.fr/mroynard/metaprog/blob/dev/include/metaprog/cpt/utility/details/traits_impl.hpp#L824
- https://gitlab.lrde.epita.fr/mroynard/metaprog/blob/dev/include/metaprog/cpt/utility/details/traits_impl.hpp#L845
OR : switch to -std=c++17 and get it done by the std trait.