Warning: mkdir(): No space left on device in /var/www/tgoop/post.php on line 37

Warning: file_put_contents(aCache/aDaily/post/misha_writes_code/--): Failed to open stream: No such file or directory in /var/www/tgoop/post.php on line 50
Миша пишет код@misha_writes_code P.118
MISHA_WRITES_CODE Telegram 118
Это хаскель? Это scala? Нет, это C++23.

Я опять все проспал, а оказывается тут такое

После появившегося в 17 плюсах std::optional теперь в 23 плюсах будет std::expected. И monadic operations для expected. И вот такой код уже очень модно выглядит.

auto res = square( 2 )
.and_then( mult_by_two )
.and_then( square );

Ну все, теперь можно говорить, что в плюсах можно писать на монадах?

std::expected уже заспавнился в популярных компиляторах, можно компилировать с -std=c++2b.

Всякие ссылки:

Proposal: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html

Cppreference: https://en.cppreference.com/w/cpp/utility/expected

Godbolt: https://godbolt.org/z/3a1j6d63a
👍4🤯32



tgoop.com/misha_writes_code/118
Create:
Last Update:

Это хаскель? Это scala? Нет, это C++23.

Я опять все проспал, а оказывается тут такое

После появившегося в 17 плюсах std::optional теперь в 23 плюсах будет std::expected. И monadic operations для expected. И вот такой код уже очень модно выглядит.


auto res = square( 2 )
.and_then( mult_by_two )
.and_then( square );

Ну все, теперь можно говорить, что в плюсах можно писать на монадах?

std::expected уже заспавнился в популярных компиляторах, можно компилировать с -std=c++2b.

Всякие ссылки:

Proposal: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html

Cppreference: https://en.cppreference.com/w/cpp/utility/expected

Godbolt: https://godbolt.org/z/3a1j6d63a

BY Миша пишет код




Share with your friend now:
tgoop.com/misha_writes_code/118

View MORE
Open in Telegram


Telegram News

Date: |

The administrator of a telegram group, "Suck Channel," was sentenced to six years and six months in prison for seven counts of incitement yesterday. With Bitcoin down 30% in the past week, some crypto traders have taken to Telegram to “voice” their feelings. Invite up to 200 users from your contacts to join your channel While the character limit is 255, try to fit into 200 characters. This way, users will be able to take in your text fast and efficiently. Reveal the essence of your channel and provide contact information. For example, you can add a bot name, link to your pricing plans, etc. A few years ago, you had to use a special bot to run a poll on Telegram. Now you can easily do that yourself in two clicks. Hit the Menu icon and select “Create Poll.” Write your question and add up to 10 options. Running polls is a powerful strategy for getting feedback from your audience. If you’re considering the possibility of modifying your channel in any way, be sure to ask your subscribers’ opinions first.
from us


Telegram Миша пишет код
FROM American