Boost's data-driven tests' join operator `+` corrupts first column

≯℡__Kan透↙ 提交于 2019-12-04 07:42:50

That's a bug. Long story short: please report it to the library maintainers.

Indeed, the zip operation returns a tuple std::tuple<int const&, int const&>:

and though the dataset itself is properly alive at the time, the tuple is returned by reference in the join operation...:

    sample const&       operator*() const   { return m_first_size > 0 ? *m_it1 : *m_it2; }

The proper fix would be to extend the dataset concept to not only have a ::sample type¹ but also a ::reference type. That's quite an invasive change.


¹ strangely not documented at this time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!