Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- class A{
- public:
- int value;
- A() : value(1){}
- A(int x) : value(x){}
- };
- template<class C>
- class B{
- public:
- std::vector<C> v;
- };
- int main() {
- A a{100};
- B<A> b{};
- b.v.push_back(a);
- std::cout << b.v[0].value << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement