有没有其他方法来确定容器的大小:
//those are valid iterators from a container
BidIt begin;
BidIt end;
std::size_t size = 0;
while (begin != end)
{//Here throug iterating I'm getting adventually the correct size
++size;
++begin;
}
Run Code Online (Sandbox Code Playgroud)
但我想知道我是否可以通过例如减去这个迭代器的地址或类似的东西来检查这个容器的大小.
谢谢你的帮助.