RAD Studio
ContentsIndex
PreviousUpNext
E2397: Template argument cannot have static or local linkage

Only integral constant expressions, and the address of global variables with external linkage, may be used as template arguments. For example:

template<char *x>
class foo;
const char *p = "Hello";
extern char *q;
foo<p> x;// OK: "p" is visible to the outside
foo<q> y;// OK: "q" is also globally visible
foo<"Hello"> z;// error: string literal has static linkage
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!