boostorg / boostorg/hana

"Taking control of SFINAE" does not showcase Optional's strengths properly

Open
#115 0 comments 0 reactions 0 assignees View on GitHub
documentation enhancement
Dominant language
C++
Stars
1.9k
Forks
225
PR merge metrics
No merged PRs in 30d

Description

It was pointed on the [Boost.Devel mailing list](http://article.gmane.org/gmane.comp.lib.boost.devel/261160) that the "Taking control of SFINAE" section of the tutorial could have been achieved more simply with `overload_linearly`:

``` c++
auto optionalToString = hana::overload_linearly(
[](auto&& x) -> decltype(x.toString()) { return x.toString(); },
[](auto&&) -> std::string { return "toString not defined"; }
);
```

My initial goal was to showcase `Optional`'s strengths, but clearly that example is not the right one.

Contributor guide

Open the contributing guide

Research direction

Start by reading the tutorial's "Taking control of SFINAE" section and the linked Boost.Devel discussion. The issue names no file or replacement example; done means revising that section so it showcases Optional's strengths more appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.