mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-31 11:57:15 +02:00
worked around C3517 error in VS2017 and older
This commit is contained in:
@ -142,13 +142,20 @@ template<typename F,typename /*Arg*/,typename=void>
|
|||||||
struct takes_arg_as_const_reference:
|
struct takes_arg_as_const_reference:
|
||||||
has_const_reference_arg<remove_noexcept_t<F>>{};
|
has_const_reference_arg<remove_noexcept_t<F>>{};
|
||||||
|
|
||||||
|
/* VS2017 and older issue a C3517 error when trying to obtain the type of
|
||||||
|
* an instantiation of a template function with deduced return type if
|
||||||
|
* the instantiation has not been evaluated before. Passing through this
|
||||||
|
* function solves the issue
|
||||||
|
*/
|
||||||
|
template<typename T> constexpr T force_evaluation(T);
|
||||||
|
|
||||||
template<typename F,typename Arg>
|
template<typename F,typename Arg>
|
||||||
struct takes_arg_as_const_reference<
|
struct takes_arg_as_const_reference<
|
||||||
F,Arg,
|
F,Arg,
|
||||||
boost::void_t<decltype(&F::template operator()<Arg>)>
|
boost::void_t<decltype(force_evaluation(&F::template operator()<Arg>))>
|
||||||
>:
|
>:
|
||||||
takes_arg_as_const_reference<
|
takes_arg_as_const_reference<
|
||||||
decltype(&F::template operator()<Arg>),Arg
|
decltype(force_evaluation(&F::template operator()<Arg>)),Arg
|
||||||
>{};
|
>{};
|
||||||
|
|
||||||
template<typename F,typename Arg>
|
template<typename F,typename Arg>
|
||||||
|
Reference in New Issue
Block a user