Silly MSVC

This commit is contained in:
Simon Brand
2017-10-17 13:08:31 +01:00
parent 043cb766f9
commit 2a61a302f8

View File

@@ -85,8 +85,7 @@ template <class T> struct is_optional_impl<optional<T>> : std::true_type {};
template <class T> using is_optional = is_optional_impl<decay_t<T>>;
// https://stackoverflow.com/questions/38288042/c11-14-invoke-workaround
template <
typename Fn, typename... Args,
template <typename Fn, typename... Args,
typename = enable_if_t<std::is_member_pointer<decay_t<Fn>>{}>,
int = 0>
constexpr auto invoke(Fn &&f, Args &&... args) noexcept(
@@ -95,8 +94,7 @@ constexpr auto invoke(Fn &&f, Args &&... args) noexcept(
return std::mem_fn(f)(std::forward<Args>(args)...);
}
template <
typename Fn, typename... Args,
template <typename Fn, typename... Args,
typename = enable_if_t<!std::is_member_pointer<decay_t<Fn>>{}>>
constexpr auto invoke(Fn &&f, Args &&... args) noexcept(
noexcept(std::forward<Fn>(f)(std::forward<Args>(args)...)))
@@ -493,10 +491,10 @@ struct optional_storage_base {
};
template <class T> struct optional_storage_base<T, true> {
constexpr optional_storage_base() noexcept : m_dummy(), m_has_value(false) {}
TL_OPTIONAL_MSVC_2015_CONSTEXPR optional_storage_base() noexcept : m_dummy(), m_has_value(false) {}
template <class... U>
constexpr optional_storage_base(in_place_t, U &&... u) noexcept
TL_OPTIONAL_MSVC_2015_CONSTEXPR optional_storage_base(in_place_t, U &&... u) noexcept
: m_value(std::forward<U>(u)...), m_has_value(true) {}
~optional_storage_base() = default;