mirror of
https://github.com/boostorg/hana.git
synced 2026-02-01 08:32:11 +00:00
[Foldable] Rename the different fold variants
- Rename fold{l,r,l1,r1} to fold.{right,left} with overloads.
- Rename foldlM/foldrM to monadic_fold.{left,right}
- Add no-state variants of the monadic folds
- Improve the fold's documentation
- Deprecate the previous folds; they'll be removed soon
Fixes #18.
This commit is contained in:
@@ -59,7 +59,7 @@ BOOST_HANA_CONSTANT_CHECK(
|
||||
|
||||
//! [foldable]
|
||||
auto sum_string = [](auto str) {
|
||||
return foldl(str, int_<0>, [](auto sum, auto c) {
|
||||
return fold.left(str, int_<0>, [](auto sum, auto c) {
|
||||
constexpr int i = value(c) - 48; // convert character to decimal
|
||||
return sum + int_<i>;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user