weixin_39725365
weixin_39725365
2020-12-29 12:31

Fix end() on ACE_Vector

It was based on the the base array, not the actual elements in the array.

This is an example program that would fail:

C++
#include <ace>
typedef ACE_Vector<int> Vector;
int main() {
  Vector v;
  for (Vector::iterator i = v.begin(); i != v.end(); ++i) {
    return 1;
  }
  return 0;
}
</int></ace>

该提问来源于开源项目:DOCGroup/ACE_TAO

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

10条回答

  • weixin_39923599 weixin_39923599 4月前

    Are your changes complete for this PR?

    点赞 评论 复制链接分享
  • weixin_39725365 weixin_39725365 4月前

    Compatibility with the standard library probably needs to be improved, but I don't have anything else to add to this PR.

    点赞 评论 复制链接分享
  • weixin_39923599 weixin_39923599 4月前

    I would prefer to use more std and deprecate all ACE containers but that is a huge effort, in new code we can use more std step by step

    点赞 评论 复制链接分享
  • weixin_39923599 weixin_39923599 4月前

    Thanks!

    点赞 评论 复制链接分享
  • weixin_39725365 weixin_39725365 4月前

    I would prefer to use more std and deprecate all ACE containers but that is a huge effort, in new code we can use more std step by step

    I don't think I fully processed that at the time, but for future reference does that mean I can directly use the standard C++03 library in TAO_IDL? Because there was none I was under the impression that I couldn't use it.

    点赞 评论 复制链接分享
  • weixin_39923599 weixin_39923599 4月前

    We are already using several std containers in ACE, the ones we use there should be safe to use in TAO_IDL

    点赞 评论 复制链接分享
  • weixin_39923599 weixin_39923599 4月前

    Can you extend one of the tests under ACE/tests as reproducer?

    点赞 评论 复制链接分享
  • weixin_39725365 weixin_39725365 4月前

    I tried to run the whole test suite, but it fails on Bug_2610_Regression_Test and hangs on Bug_2772_Regression_Test, long before getting to the vector test. I'm running ACE/tests/run_test.pl, is this different from the ace tests normally ran?

    点赞 评论 复制链接分享
  • weixin_39725365 weixin_39725365 4月前

    So after a several minutes (371 seconds to be precise) Bug_2772_Regression_Test timed out.

    点赞 评论 复制链接分享
  • weixin_39923599 weixin_39923599 4月前

    Some tests are known to fail, they are tagged with !FIXED_BUGS_ONLY in run_test.lst, Bug_2610_Regression and Bug_2772_Regression are both known failures.

    点赞 评论 复制链接分享

相关推荐