More C++14 void fixes

This commit is contained in:
Simon Brand
2018-06-06 13:54:12 +01:00
parent e0a542f960
commit 90b00674dd
2 changed files with 2301 additions and 4 deletions

View File

@@ -1604,8 +1604,7 @@ template <class T> optional(T)->optional<T>;
/// \exclude
namespace detail {
#if defined(TL_OPTIONAL_CXX14) && !defined(TL_OPTIONAL_GCC49) && \
!defined(TL_OPTIONAL_GCC54) && !defined(TL_OPTIONAL_GCC55)
#ifdef TL_OPTIONAL_CXX14
template <class Opt, class F,
class Ret = decltype(detail::invoke(std::declval<F>(),
*std::declval<Opt>())),
@@ -1623,10 +1622,10 @@ template <class Opt, class F,
auto optional_map_impl(Opt &&opt, F &&f) {
if (opt.has_value()) {
detail::invoke(std::forward<F>(f), *std::forward<Opt>(opt));
return monostate{};
return make_optional(monostate{});
}
return optional<Ret>(nullopt);
return optional<monostate>(nullopt);
}
#else
template <class Opt, class F,

2298
tl/optional.hpp.orig Normal file

File diff suppressed because it is too large Load Diff