Is there a way to pass auto as an argument in C++?
Is there a way to pass auto as an argument to another function? int function(auto data) { //DOES something } If you want that to mean that you can pass any type to the function, make it a template: template <typename T> int function(T data); There's a proposal for C++17 to allow the syntax you used (as C++14 already does for generic lambdas), but it's not standard yet. Templates are the way you do this with normal functions: template <typename T> int function(T data) { //DOES something } Alternatively, you could use a lambda: auto function = [] (auto data) { /*DOES something*/ }; I dont know