This following doesn't work:
// case one:
struct MyClass {
int x;
};
template <MyClass name>
void foo() {
}
But if I make it a reference it works:
// case two:
struct MyClass {
int x;
};
template <MyClass &name>
void foo() {
}
Do I need to pass a constant object of MyClass for it work with class in case one?