Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

std::function ambiguity vc++

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 1,38 sec, absolute service time: 1,41 sec 
edit mode |  history  | discussion
Error(s):
source_file.cpp(13): error C2668: 'f': ambiguous call to overloaded function
source_file.cpp(7): note: could be 'void f(std::function<void (std::unique_ptr<Message,std::default_delete<_Ty>>)>)'
        with
        [
            _Ty=Message
        ]
source_file.cpp(6): note: or       'void f(std::function<void (std::shared_ptr<Message>)>)'
source_file.cpp(13): note: while trying to match the argument list '(main::<lambda_74e2623b229b211f81b1a3c3b65ece6f>)'
source_file.cpp(14): error C2668: 'f': ambiguous call to overloaded function
source_file.cpp(7): note: could be 'void f(std::function<void (std::unique_ptr<Message,std::default_delete<_Ty>>)>)'
        with
        [
            _Ty=Message
        ]
source_file.cpp(6): note: or       'void f(std::function<void (std::shared_ptr<Message>)>)'
source_file.cpp(14): note: while trying to match the argument list '(main::<lambda_21839c5d74c88cf6484b5fc354d78716>)'
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64