result: remove broken map()
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Fri, 28 Jul 2017 07:56:21 +0000 (09:56 +0200)
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>
Tue, 8 Aug 2017 15:24:00 +0000 (17:24 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
src/result.hpp

index 4768d9f..b740a0c 100644 (file)
@@ -39,9 +39,6 @@ struct result {
    optional<T> ok() const { return this->t; }
    optional<char const *> err() const { return optional<char const *>(this->e); }
 
-   template <typename U>
-   result<U> map(std::function<U(T)> f);
-
    result<T> map_err(std::function<char const *(char const *)> f);
 };
 
@@ -55,15 +52,6 @@ struct result<T> Ok(T t) {
    return result<T>{nullptr, t};
 }
 
-template <typename T>
-template <typename U>
-result<U> result<T>::map(std::function<U(T)> f) {
-   if (this->is_ok()) {
-      return Ok<U>(f(this->unwrap()));
-   }
-   return Err<U>(this->e);
-}
-
 template <typename T>
 result<T> result<T>::map_err(std::function<char const *(char const *)> f) {
    if (this->is_err()) {