# include <iostream> # include <vector> // vectorのラッパークラス template<typename T> class Foo { std::vector<T> data_; public: Foo(const std::vector<T>& data) : data_(data) {} // コピーのコストを嫌ってconst参照で返すゲッター const std::vector<T>& data() const { return data_; } }; // テンプレート引数を省略するためのファクトリ template<typename T> Foo<T> make_foo(const std::vector<T>& data) { return Foo<T>(data); }; int main() { std::vector<int>
