shared_vector limit MSVC workaround

limit 207efca15c
to MSVC <= 2010.
This commit is contained in:
Michael Davidsaver
2018-01-05 11:13:56 -08:00
parent 34145e459b
commit 0b6b01ef83

View File

@@ -459,11 +459,11 @@ private:
/* Hack alert.
* For reasons of simplicity and efficiency, we want to use raw pointers for iteration.
* However, shared_ptr::get() isn't defined when !m_sdata, although practically it gives NULL.
* Unfortunately, many of the MSVC STL methods assert() that iterators are never NULL.
* Unfortunately, many of the MSVC (<= VS 2010) STL methods assert() that iterators are never NULL.
* So we fudge here by abusing 'this' so that our iterators are always !NULL.
*/
inline E* base_ptr() const {
#ifdef _MSC_VER
#if defined(_MSC_VER) && _MSC_VER<=1600
return this->m_count ? this->m_sdata.get() : (E*)(this-1);
#else
return this->m_sdata.get();