Original Post
I've looked online and in a book for help and can't seem to define an iterator for my container class yet. I'm trying to delegate, since it's a relatively simple container. I'm using the following class (the following is reduced to its basis, there are a lot of methods defined to give it the desired container traits): template class Profile { private: typedef list< pair > ProfileData; ProfileData data; // I have now (but I cant decipher the errors): public: typedef ProfileData::iterator iterator; typedef ProfileData::const_iterator const_iterator; } I want the end user to be able to write: Profile mProf; // Add data to mProf Profile::iterator pIt; for(pIt = mProf.begin(); pIt != mProf.end(); pIt++) { // Do stuff } What is the right way to do this (code cleanup appreciated too! :) )? 2nd question: Is it generally encouraged to ask questions on the forums here when learning a new topic (after doing research and attempting to solve the problem) even though I haven't spent several days trying out various solutions. That is... for how long should one attempt to solve a problem before coming to the boards when learning completely new areas of programming?