#include <iostream>
#include <type_traits>
#include <vector>
#include <string>
#include <functional>
#include <map>
#include <algorithm>
using namespace std;
struct Custom
{
//overload operator()
template<typename... Args>
void operator()(const Args&...args)
{
std::cout << "operator() called with: "<<sizeof...(args)<<" arguments"<<std::endl;
}
};
template <class Something>
void foo(Something s)
{
s(0, "--limit", "Limits the number of elements."); //call the overloaded operator()
s(false, "--all", "Run all", 5.5, 5); //call the overloaded operator()
}
int main()
{
Custom c; //create object of class type Custom
foo(c); //call foo by passing argument of type `Custom`
}