forked from TartanLlama/optional
More C++14 void fixes
This commit is contained in:
@@ -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
2298
tl/optional.hpp.orig
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user