std-expected Questions
1
Solved
I'm reading the documentation on std::expected::operator==, and apparently it's not SFINAE-friendly. Instead of "doesn't participate in overload resolution if [types are not eq-comparable]&quo...
Eward asked 20/9, 2024 at 11:16
7
In C++23, given:
expected<A, string> getA(const X& x);
expected<B, string> getB(const Y& y);
C compute_all(const A& a, const B& b);
Is there a way to avoid a classic s...
Geophysics asked 11/7, 2024 at 9:47
1
Solved
When should I use std::expected and when should I use exceptions? Take this function for example:
int parse_int(std::string_view str) {
if (str.empty()) {
throw std::invalid_argument("string...
Diverticulum asked 12/6, 2023 at 22:16
1
Solved
In one of the most respected stackoverflow answer I found an example of std::expected template class usages:
What are coroutines in C++20?
At the same time I cannot find any mentioning of this clas...
Tumefacient asked 13/7, 2021 at 19:50
1
© 2022 - 2025 — McMap. All rights reserved.