我是 c++ 编程的新手,我需要创建迭代器,但我遇到了循环问题(在 c++11 中),因为它无法识别元素,我解释说:
class myclass{
    std::string str;
    myclass();
    std::iterator<(what do i have to put here?), char, diffptr_t, char*, char&> begin(){
       return str.begin();
    }
}
这是读取类的方法:
 void func(myclass& m){
     for(char a: m){ //Here's the problem, i don't know why it doesn't work
         //do function  
     }
任何人都可以告诉哪个是最好的方法吗?这里有什么问题???