От: | prog123 | ||
Дата: | 17.05.17 10:14 | ||
Оценка: |
#include <functional>
#include <cstdint>
class error_code
{
};
template <typename result_type>
class work
{
public:
using callback = std::function <void(result_type)>;
using a_callback = std::function <void(int64_t duration_ms, result_type ec)>;
void async_call(a_callback cb){};
void async_call(callback cb){};
};
int main(int, char**)
{
std::function <void(error_code)> cb;
work<error_code> w;
w.async_call([cb](int64_t duration, error_code ec)
{
});
return 0;
}
error C2668: 'work<error_code>::async_call' : ambiguous call to overloaded function
could be 'void work<error_code>::async_call(std::function<void (error_code)>)'
or 'void work<error_code>::async_call(std::function<void (int64_t,result_type)>)'
with
[
result_type=error_code
]
while trying to match the argument list '(main::<lambda_7d2398af0e7f9b7dcb8924b86226e87d>)'