RAD Studio
ContentsIndex
PreviousUpNext
E2393: Cannot take the address of non-type, non-reference template parameter 'parameter'

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
}
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!