Attempt to fix cpp11_result_of for MSVC

MSVC fails with:

cpp11_result_of_wrap.cxx(3211): error C2672: 'test_result_impl': no matching overloaded function found
cpp11_result_of_wrap.cxx(3211): error C2893: Failed to specialize function template 'std::result_of<Fun(Arg)>::type test_result_impl(Fun,Arg)'
cpp11_result_of_wrap.cxx(3150): note: see declaration of 'test_result_impl'
cpp11_result_of_wrap.cxx(3211): note: With the following template arguments:
cpp11_result_of_wrap.cxx(3211): note: 'Fun=double (__cdecl *)(double)'
cpp11_result_of_wrap.cxx(3211): note: 'Arg=int'

Try making the second parameter double to match the template.
This commit is contained in:
Olly Betts 2022-07-26 10:30:19 +12:00
parent 4a15f3934d
commit 4f44d0a1ea
1 changed files with 4 additions and 4 deletions

View File

@ -55,10 +55,10 @@ std::result_of< fn_ptr(double) >::type test_result_alternative1(double(*fun)(dou
#include <iostream>
void cpp_testing() {
std::cout << "result: " << test_result_impl(square, 3) << std::endl;
std::cout << "result: " << test_result_impl<double(*)(double), double>(square, 4) << std::endl;
std::cout << "result: " << test_result_impl< fn_ptr, double >(square, 5) << std::endl;
std::cout << "result: " << test_result_alternative1(square, 6) << std::endl;
std::cout << "result: " << test_result_impl(square, 3.0) << std::endl;
std::cout << "result: " << test_result_impl<double(*)(double), double>(square, 4.0) << std::endl;
std::cout << "result: " << test_result_impl< fn_ptr, double >(square, 5.0) << std::endl;
std::cout << "result: " << test_result_alternative1(square, 6.0) << std::endl;
}
%}