今天才发现,C++中结构体不仅能够定义方法,还能有继承关系。如下面代码所示:
namespace std{
struct output_iterator_tag{};
struct input_iterator_tag{};
struct forward_iterator_tag
:public input_iterator_tag{
};
struct bidirectional_iterator_tag
:public forward_iterator_tag{
};
struct random_access_iterator_tag
:public bidirectional_iterator_tag{
};
}
不可思议!