diff --git a/tl/optional.hpp b/tl/optional.hpp index 8961721..64c1cdc 100644 --- a/tl/optional.hpp +++ b/tl/optional.hpp @@ -765,25 +765,25 @@ public: /// \group map /// \synopsis template constexpr auto map(F &&f) &; template TL_OPTIONAL_11_CONSTEXPR auto map(F &&f) & { - return map_impl(*this, std::forward(f)); + return optional_map_impl(*this, std::forward(f)); } /// \group map /// \synopsis template constexpr auto map(F &&f) &&; template TL_OPTIONAL_11_CONSTEXPR auto map(F &&f) && { - return map_impl(std::move(*this), std::forward(f)); + return optional_map_impl(std::move(*this), std::forward(f)); } /// \group map /// \synopsis template constexpr auto map(F &&f) const&; template constexpr auto map(F &&f) const & { - return map_impl(*this, std::forward(f)); + return optional_map_impl(*this, std::forward(f)); } /// \group map /// \synopsis template constexpr auto map(F &&f) const&&; template constexpr auto map(F &&f) const && { - return map_impl(std::move(*this), std::forward(f)); + return optional_map_impl(std::move(*this), std::forward(f)); } #else /// \brief Carries out some operation on the stored object if there is one. @@ -796,38 +796,38 @@ public: /// \group map /// \synopsis template auto map(F &&f) &; template - TL_OPTIONAL_11_CONSTEXPR decltype(map_impl(std::declval(), + TL_OPTIONAL_11_CONSTEXPR decltype(optional_map_impl(std::declval(), std::declval())) map(F &&f) & { - return map_impl(*this, std::forward(f)); + return optional_map_impl(*this, std::forward(f)); } /// \group map /// \synopsis template auto map(F &&f) &&; template - TL_OPTIONAL_11_CONSTEXPR decltype(map_impl(std::declval(), + TL_OPTIONAL_11_CONSTEXPR decltype(optional_map_impl(std::declval(), std::declval())) map(F &&f) && { - return map_impl(std::move(*this), std::forward(f)); + return optional_map_impl(std::move(*this), std::forward(f)); } /// \group map /// \synopsis template auto map(F &&f) const&; template - constexpr decltype(map_impl(std::declval(), + constexpr decltype(optional_map_impl(std::declval(), std::declval())) map(F &&f) const & { - return map_impl(*this, std::forward(f)); + return optional_map_impl(*this, std::forward(f)); } #ifndef TL_OPTIONAL_NO_CONSTRR /// \group map /// \synopsis template auto map(F &&f) const&&; template - constexpr decltype(map_impl(std::declval(), + constexpr decltype(optional_map_impl(std::declval(), std::declval())) map(F &&f) const && { - return map_impl(std::move(*this), std::forward(f)); + return optional_map_impl(std::move(*this), std::forward(f)); } #endif #endif @@ -1604,7 +1604,7 @@ template (), *std::declval())), detail::enable_if_t::value> * = nullptr> -constexpr auto map_impl(Opt &&opt, F &&f) { +constexpr auto optional_map_impl(Opt &&opt, F &&f) { return opt.has_value() ? detail::invoke(std::forward(f), *std::forward(opt)) : optional>(nullopt); @@ -1614,7 +1614,7 @@ template (), *std::declval())), detail::enable_if_t::value> * = nullptr> -auto map_impl(Opt &&opt, F &&f) { +auto optional_map_impl(Opt &&opt, F &&f) { if (opt.has_value()) { detail::invoke(std::forward(f), *std::forward(opt)); return monostate{}; @@ -1628,7 +1628,7 @@ template ())), detail::enable_if_t::value> * = nullptr> -constexpr auto map_impl(Opt &&opt, F &&f) -> optional> { +constexpr auto optional_map_impl(Opt &&opt, F &&f) -> optional> { return opt.has_value() ? detail::invoke(std::forward(f), *std::forward(opt)) : optional>(nullopt); @@ -1639,7 +1639,7 @@ template ())), detail::enable_if_t::value> * = nullptr> -auto map_impl(Opt &&opt, F &&f) -> optional { +auto optional_map_impl(Opt &&opt, F &&f) -> optional { if (opt.has_value()) { detail::invoke(std::forward(f), *std::forward(opt)); return monostate{}; @@ -1805,25 +1805,25 @@ public: /// \group map /// \synopsis template constexpr auto map(F &&f) &; template TL_OPTIONAL_11_CONSTEXPR auto map(F &&f) & { - return detail::map_impl(*this, std::forward(f)); + return detail::optional_map_impl(*this, std::forward(f)); } /// \group map /// \synopsis template constexpr auto map(F &&f) &&; template TL_OPTIONAL_11_CONSTEXPR auto map(F &&f) && { - return detail::map_impl(std::move(*this), std::forward(f)); + return detail::optional_map_impl(std::move(*this), std::forward(f)); } /// \group map /// \synopsis template constexpr auto map(F &&f) const&; template constexpr auto map(F &&f) const & { - return detail::map_impl(*this, std::forward(f)); + return detail::optional_map_impl(*this, std::forward(f)); } /// \group map /// \synopsis template constexpr auto map(F &&f) const&&; template constexpr auto map(F &&f) const && { - return detail::map_impl(std::move(*this), std::forward(f)); + return detail::optional_map_impl(std::move(*this), std::forward(f)); } #else /// \brief Carries out some operation on the stored object if there is one. @@ -1836,38 +1836,38 @@ public: /// \group map /// \synopsis template auto map(F &&f) &; template - TL_OPTIONAL_11_CONSTEXPR decltype(detail::map_impl(std::declval(), + TL_OPTIONAL_11_CONSTEXPR decltype(detail::optional_map_impl(std::declval(), std::declval())) map(F &&f) & { - return detail::map_impl(*this, std::forward(f)); + return detail::optional_map_impl(*this, std::forward(f)); } /// \group map /// \synopsis template auto map(F &&f) &&; template - TL_OPTIONAL_11_CONSTEXPR decltype(detail::map_impl(std::declval(), + TL_OPTIONAL_11_CONSTEXPR decltype(detail::optional_map_impl(std::declval(), std::declval())) map(F &&f) && { - return detail::map_impl(std::move(*this), std::forward(f)); + return detail::optional_map_impl(std::move(*this), std::forward(f)); } /// \group map /// \synopsis template auto map(F &&f) const&; template - constexpr decltype(detail::map_impl(std::declval(), + constexpr decltype(detail::optional_map_impl(std::declval(), std::declval())) map(F &&f) const & { - return detail::map_impl(*this, std::forward(f)); + return detail::optional_map_impl(*this, std::forward(f)); } #ifndef TL_OPTIONAL_NO_CONSTRR /// \group map /// \synopsis template auto map(F &&f) const&&; template - constexpr decltype(detail::map_impl(std::declval(), + constexpr decltype(detail::optional_map_impl(std::declval(), std::declval())) map(F &&f) const && { - return detail::map_impl(std::move(*this), std::forward(f)); + return detail::optional_map_impl(std::move(*this), std::forward(f)); } #endif #endif