C++では?
C++マスターの皆様には常識なのかも知れませんが、私は知らないので試してみました。
#includeusing namespace std; string const m = "global"; template void A(T arg) { cout << m << arg << endl; } int main() { string const m = "local"; A(100); }
...>bcc32 temp Borland C++ 5.6.4 for Win32 Copyright (c) 1993, 2002 Borland temp.cpp: Turbo Incremental Link 5.65 Copyright (c) 1997-2002 Borland ...>temp global100
ふむ、static scope。常識的動作。こうじゃないとバグの温床ですよね。
一応dmcでも試して見ましたが同じでした。