can i create 1 template that i use inside the class and not when i create the class object?
cambalinho
125
Practically a Posting Shark
Recommended Answers
Jump to PostDo you mean a data member which is a template?
Jump to PostDo you mean something 'ugly' like this?
#include <iostream> template <class T> class me { public: me():t(0) {} void create_T_pointer(const T & v) { t = new T(v); } const T* get_data() const { return t; } private: T * t; }; template <class T> std::ostream& operator …
All 5 Replies
gerard4143
371
Nearly a Posting Maven
cambalinho
125
Practically a Posting Shark
gerard4143
371
Nearly a Posting Maven
cambalinho
125
Practically a Posting Shark
mike_2000_17
2,669
21st Century Viking
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.