Let's say I have a template function taking a class object:
template<class T>
void Foo(T obj);
and a class definition as follows:
class Bar
{
public:
Bar(int a, bool b): _a(a), _b(b) {}
private:
int _a;
bool _b;
};
Is there a way to make the following code compile?
Foo<Bar>(5,false);
Foo<Bar>({5,false}); // i know this works, just wondering if i can remove the brackets somehow.
Foo
takes a single argument and inFoo<Bar>(5,false);
you're passing two arguments. – Trow