Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > vectors and tem...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 44119 of 48044
Post > Topic >>

vectors and template types

by aryan <mohan.kiran@[EMAIL PROTECTED] > Mar 25, 2008 at 11:35 PM

I need to iterate thru a vector which holds an unknown type. I am
using templates and it looks like this after details are removed.

template <class T>
class set
{
    vector<T> set_v;
    public:
    void insert(const T&);
};

template <class T>
void set<T>::insert(const T &t)
{
    vector<T>::iterator itr;                  //This line does not
compile. error:  expected `;' before "itr"
    //......
    //......
};

Pls let me know what i am doing wrong.
 




 3 Posts in Topic:
vectors and template types
aryan <mohan.kiran@[EM  2008-03-25 23:35:20 
Re: vectors and template types
Kai-Uwe Bux <jkherciue  2008-03-26 02:48:31 
Re: vectors and template types
"Jim Langston"   2008-03-26 00:19:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 22:36:36 CDT 2008.