Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- template <typename T>
- class SimpleVector
- {
- public:
- explicit SimpleVector(size_t size)
- {
- data = new T[size];
- }
- ~SimpleVector()
- {
- delete[]data;
- }
- private:
- T* data;
- };
- int main()
- {
- SimpleVector<int> sv(5);
- ------------------------
- SimpleVector<string> sv(5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement