std::vector私がsを持っているとしましょうstd::string。
// Foo.h
class Foo {
std::vector< std::string > mVectorOfFiles;
}
それから私はtypedefそれをStringVectorタイプにしました。
// Foo.h
typedef std::vector< std::string > StringVector;
class Foo {
StringVector mVectorOfFiles;
}
オブジェクトを受け取る別のクラスがあるStringVector場合...
// Bar.h
class Bar {
Bar( const StringVector & pVectorOfFiles ); // I assume this produces a compile error (?) since Bar has no idea what a StringVector is
}
...typedefのヘッダーファイルで再度使用する必要がありますBarか?
// Bar.h
typedef std::string< std::vector > StringVector;
class Bar {
Bar( StringVector pListOfFiles );
}
typedef std::vector< std::string > StringVectorを1つのファイルに入れて、他のすべてのクラスにタイプを認識させることは可能StringVectorですか?