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

std::function ambiguity gcc

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.32 sec, absolute service time: 0,4 sec 
edit mode |  history  | discussion
Error(s):
source_file.cpp: In function ‘int main()’:
source_file.cpp:13:7: error: call of overloaded ‘f(main()::<lambda(std::shared_ptr<Message>)>&)’ is ambiguous
   f(f1);
       ^
source_file.cpp:6:6: note: candidate: void f(std::function<void(std::shared_ptr<Message>)>)
 void f(std::function<void(std::shared_ptr<Message>)> arg) {}
      ^
source_file.cpp:7:6: note: candidate: void f(std::function<void(std::unique_ptr<Message>)>)
 void f(std::function<void(std::unique_ptr<Message>)> arg) {}
      ^

        

    
                
λ
.NET NoSQL database for rapid development