Possible duplicate of Non-type template parameters
These are the rules of template non type parameters
A non-type template-parameter shall have one of the following (optionally cv-qualified) types:
- integral or enumeration type,
- pointer to object or pointer to function,
- lvalue reference to object or lvalue reference to function,
- pointer to member,
std::nullptr_t
.
What you are passing is an RValue (temporary object, etc which cannot be assigned to), which does not fall under any of these possibilities.
edit:
It appears that it is infact being interpreted as a function type, but your template signature expects a non type parameter of type A
(exactly a const A&
)