LoginSignup
0
0

More than 5 years have passed since last update.

Effective C++ (3rd) > 31項 > string > クラスでなくbasic_string<char>をtypedefしたもの

Last updated at Posted at 2015-05-15

引用: Effective C++ 第3版

stringはクラスではなく、basic_stringをtypedefしたものです。そのため、stringの前方宣言は誤りということになります。正しい前方宣言は、他のテンプレートも含めなくてはならないので、もっとずっと複雑になります。しかし、それは大きな問題ではありません。そもそも標準ライブラリの一部を取り出して前方宣言するべきではないのです。標準ライブラリについては、単純に#includeを使えばよいのです。

  • std::wstring
  • std::u16string
  • std::u32string

SO

See §21.4 Class template basic_string [basic.string] of the C++11 specification.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0