iterator creation in my own class c++11
I'm novice in c++ programming and i need to create iterator but i'm having
problems with the loop (in c++11) because it doesn't recognize the
elements, i explain:
class myclass{
std::string str;
myclass();
std::iterator<(what do i have to put here?), char, diffptr_t, char*,
char&> begin(){
return str.begin();
}
}
This the method that reads the class:
void func(myclass& m){
for(char a: m){ //Here's the problem, i don't know why it doesn't work
//do function
}
Can any body tell which is the best method for do that?? and what's wrong
here???
No comments:
Post a Comment