Work around an incorrect assertion in older versions of boost. Closes #1702.

This commit is contained in:
Thomas Goyne 2014-02-02 09:14:33 -08:00
parent 0523c27393
commit 3c59903420

View file

@ -60,7 +60,15 @@ std::shared_ptr<VideoFrame> VideoProviderCache::GetFrame(int n) {
for (auto cur = cache.begin(); cur != cache.end(); ++cur) {
if (cur->frame_number == n) {
#if BOOST_VERSION <= 105200
// Until boost 1.52, boost::container::list incorrectly asserted
// that this != &other, so do an extra splice through an empty list
decltype(cache) temp;
temp.splice(temp.begin(), cache, cur);
cache.splice(cache.begin(), temp, temp.begin());
#else
cache.splice(cache.begin(), cache, cur); // Move to front
#endif
return std::make_shared<VideoFrame>(cache.front());
}