2008-10-05
テンプレートのメンバ関数がインスタンス化される箇所
以下のエントリで色々と勉強になりました
クラステンプレートの具現化の位置 - hattorix0の日記
ありがとうございます!
重要なのは以下の箇所
For a function template specialization, a member function template specialization, or a specialization for a member function or static data member of a class template, if the specialization is implicitly instantiated because it is referenced from within another template specialization and the context from which it is referenced depends on a template parameter, the point of instantiation of the specialization is the point of instantiation of the enclosing specialization. Otherwise, the point of instantiation for such a specialization immediately follows the namespace scope declaration or definition that refers to the specialization.
ISO/IEC 14882:1998(E) -- C++ -- Templates
ただ、この文章
For a function template specialization, a member function template specialization, or a specialization for a member function or static data member of a class template
- if the specialization is implicitly instantiated because it is referenced from within another template specialization and the context from which it is referenced depends on a template parameter, the point of instantiation of the specialization is the point of instantiation of the enclosing specialization.
- Otherwise, the point of instantiation for such a specialization immediately follows the namespace scope declaration or definition that refers to the specialization.
という意味なのか
- For a function template specialization, a member function template specialization, or a specialization for a member function or static data member of a class template, if the specialization is implicitly instantiated because it is referenced from within another template specialization and the context from which it is referenced depends on a template parameter, the point of instantiation of the specialization is the point of instantiation of the enclosing specialization.
- Otherwise, the point of instantiation for such a specialization immediately follows the namespace scope declaration or definition that refers to the specialization.
という意味なのか
For a function template specialization, a member function template specialization, or a specialization for a member function or static data member of a class template
の文が、最初の文章だけにかかるのか、段落全体にかかるのか、が分からない。
その後に続く文章の感じからすると後者かなあ。
あ、ひょっとして
such a specialization
ってのが
For a function template specialization, a member function template specialization, or a specialization for a member function or static data member of a class template
のことなのか!なるほど!
such! such!
- 46 http://reader.livedoor.com/reader/
- 30 http://d.hatena.ne.jp/HolyGrail/20081001/1222880038
- 25 http://www.google.co.jp/search?sourceid=navclient&hl=ja&ie=UTF-8&rls=GGLG,GGLG:2005-44,GGLG:ja&q=chromeのJavaScript
- 21 http://anond.hatelabo.jp/20081002025403
- 20 http://blog.livedoor.jp/ikiradio/archives/51043067.html
- 20 http://www.google.co.jp/reader/view/
- 19 http://www.google.co.jp/search?hl=ja&client=firefox-a&rls=org.mozilla:ja-JP-mac:official&hs=iZt&q=javascript クラス&btnG=検索&lr=lang_ja
- 18 http://www.google.co.jp/search?q=amachang&lr=lang_ja&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:ja-JP-mac:official&client=firefox-a
- 18 http://www.google.co.jp/search?sourceid=navclient&aq=t&hl=ja&ie=UTF-8&rlz=1T4GGIH_jaJP275JP275&q=SVG+javascript
- 16 http://www.google.com/reader/view/
