stl里的stringmenber types里含有的value_type等也是类型别名,迭代器也是。如果是用户自定义一个string, T,T*的写法明显比value_type、pointer更方便。
private 底下的那些,主要就是因为原类型名完整写出来太长,于是取个短名字。public 底下那些,除了名字...
{ public: using iterator_category = std::forward_iterator_tag; using value_type = typename Container::value_type; using difference_type = std::ptrdiff_t; using pointer = value_type*; using reference = value_type&; // 构造函数、析构函数、操作符重载等 }; // 修改后的代码,不再继承 ...
Sign up for freeto join this conversation on GitHub.Already have an account?Sign in to comment