RAD Studio |  |

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

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:

Copy Code

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

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!