LoopPerfect / neither

Either and Maybe monads for better error-handling in C++ ↔️
MIT License
249 stars 18 forks source link

Remove copy construction from argument to std::move in rightMap && #26

Closed WojciechMigda closed 5 years ago

WojciechMigda commented 5 years ago

When rightMap is applied to Either containing non-copyable type instance, such as std::unique_ptr<T>, then the compiler will hard fail trying to deduce types (rightMap && should be picked) because there is (R2) cast applied to std::move argument, thus forcing copy construction.

leftMap works because it does not have such cast.

nikhedonia commented 5 years ago

Nice Spot! :1st_place_medal: