E2393 Cannot take the address of non-type, non-reference template parameter 'parameter' (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

A template parameter has no address, and is not associated with any real "object". Therefore, to take its address, or attempt to assign to it, has no meaning. For example:

template<int U>
void foo()
{
int *x = &U;// error: cannot take address of parameter
}