草庐IT

c++ - 在这种情况下我应该避免使用 "goto"吗?

我正在制作一个“连接迭代器”,即一个将迭代int**中的int的迭代器。它的构造函数需要:一个T**数组,代表每个子数组的开始。一个T**的数组,代表每个子数组的结尾。瞧,我遇到了goto似乎是合适的情况。但我内心的某些东西在尖叫“不!!”所以我想我应该来这里问:我应该尽量避免goto这样的情况吗?(如果我这样做会提高可读性吗?)#includetemplateclasslazy_concat_iterator{//Thiscodewasmeanttoworkforanyvalidinputiterator//butforeasierreading,I'llassumethetypei