Browse Source

external: updated std::optional with fixed MSVC 2013 port.

Vladimír Vondruš 13 years ago
parent
commit
49b3c9121e
  1. 8
      external/Optional/optional.hpp

8
external/Optional/optional.hpp vendored

@ -195,7 +195,7 @@ template <class T> inline constexpr typename std::remove_reference<T>::type&& co
# elif defined __GNUC__ # elif defined __GNUC__
_assert(expr, file, line); _assert(expr, file, line);
# elif defined _MSC_VER # elif defined _MSC_VER
_CrtDbgReport(_CRT_ASSERT, file, line, expr); _CrtDbgReport(_CRT_ASSERT, file, line, expr, "");
# else # else
# error UNSUPPORTED COMPILER # error UNSUPPORTED COMPILER
# endif # endif
@ -230,11 +230,15 @@ T* static_addressof(T& ref)
return std::addressof(ref); return std::addressof(ref);
} }
#else #else
# if (defined _MSC_VER) && _MSC_VER >= 1800
// leave it; our metafunctions are already defined.
# else
template <typename T> template <typename T>
T* addressof(T& ref) T* addressof(T& ref)
{ {
return reinterpret_cast<T*>(&const_cast<char&>(reinterpret_cast<const volatile char&>(ref))); return reinterpret_cast<T*>(&const_cast<char&>(reinterpret_cast<const volatile char&>(ref)));
} }
#endif
template <typename T> template <typename T>
T* static_addressof(T& ref) T* static_addressof(T& ref)
{ {
@ -420,7 +424,7 @@ struct constexpr_optional_base
}; };
#endif #endif
# if OPTIONAL_HAS_USING # if OPTIONAL_HAS_USING && OPTIONAL_HAS_CONSTEXPR_NOEXCEPT
template <class T> template <class T>
using OptionalBase = typename std::conditional< using OptionalBase = typename std::conditional<
std::is_trivially_destructible<T>::value, std::is_trivially_destructible<T>::value,

Loading…
Cancel
Save