Open danakj opened 1 year ago
Instead of
sus::move(it).map([](auto&& x) { return *x; }).map([](InnerT& t) { ... })
It would be nice
sus::move(it).deref().map([](InnerT& t) { ... })
Which does the same thing but more clear.
Smart pointers are super common in C++ so this is important, and the simple map function is very verbose compared to rust's .map(|x| *x).
.map(|x| *x)
This way code does not need to worry about what smart pointers are in use, they never appear in the signature either.
Currently some C++ smart pointers end up with implicit conversions to avoid the work of writing out their type and the dereferences.
Instead of
It would be nice
Which does the same thing but more clear.
Smart pointers are super common in C++ so this is important, and the simple map function is very verbose compared to rust's
.map(|x| *x)
.This way code does not need to worry about what smart pointers are in use, they never appear in the signature either.
Currently some C++ smart pointers end up with implicit conversions to avoid the work of writing out their type and the dereferences.