mirror of
https://github.com/boostorg/optional.git
synced 2025-07-31 04:57:17 +02:00
cleaner workaround for VS2017 launder bug
This commit is contained in:
@ -60,12 +60,14 @@ class aligned_storage
|
|||||||
T * ptr_ref() { return static_cast<T *> (address()); }
|
T * ptr_ref() { return static_cast<T *> (address()); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BOOST_MSVC // workaround for MSVC 14.1 compiler crash
|
#if BOOST_WORKAROUND(BOOST_MSVC, < 1920)
|
||||||
T const& ref() const { return *boost::core::launder(ptr_ref()); }
|
// workaround for VS2017 (32 bit) compiler crash
|
||||||
T & ref() { return *boost::core::launder(ptr_ref()); }
|
// toolset=msvc-14.1 cxxstd=17 variant=release address-model=32
|
||||||
#else
|
|
||||||
T const& ref() const { return *ptr_ref(); }
|
T const& ref() const { return *ptr_ref(); }
|
||||||
T & ref() { return *ptr_ref(); }
|
T & ref() { return *ptr_ref(); }
|
||||||
|
#else
|
||||||
|
T const& ref() const { return *boost::core::launder(ptr_ref()); }
|
||||||
|
T & ref() { return *boost::core::launder(ptr_ref()); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
Reference in New Issue
Block a user