Search code examples
What's the advantage of `std::optional` over `std::shared_ptr` and `std::unique_ptr`?...


c++option-typec++17stdoptional

Read More
Why does std::optional not have a specialization for reference types?...


c++c++11language-designstdoptionalboost-optional

Read More
Can I have a std::optional<T> if T is neither constructible nor copyable nor movable?...


c++c++17stdoptional

Read More
Iterating over std::optional...


c++option-typestdoptional

Read More
Overhead of std::optional<T>?...


performanceg++c++14overheadstdoptional

Read More
Is it ok to double-dereference ("**itOpt") an optional iterator?...


c++iteratorclangdereferencestdoptional

Read More
Does passing an std::optional<T> by reference actually save copying?...


c++stdoptional

Read More
`std::optional` factory function with guaranteed copy elision and `private` constructor, without pas...


c++c++17explicitcopy-elisionstdoptional

Read More
Why is it undefined behavior to call operator* on an empty std::optional if I don't access the r...


c++undefined-behaviorstdoptional

Read More
Is use of empty std::optional<string> UB or not?...


c++undefined-behaviorstdoptional

Read More
What's the difference between C++23's optional::transform and optional::and_then?...


c++monadsmonad-transformersstdoptionalc++23

Read More
Is it useful to construct an std::optional using std::in_place when returning from a function?...


c++c++20copy-elisionstdoptional

Read More
Unexpected behavior of std::is_copy_assignable and boost::optional...


c++boosttype-traitsstdoptionalboost-optional

Read More
error: cannot convert 'std::optional<int>' to 'const int' in initialization...


c++foldstd-rangesc++23stdoptional

Read More
Writing functions which handle invalid inputs in C++...


c++functionstdoptional

Read More
Pass-through constructor for std::optional arguments...


c++c++17stdoptional

Read More
Pass-through constructor for std::optional argument...


c++c++17stdoptional

Read More
namespace std:: does not contain optional...


c++stdoptional

Read More
Is there another way to achieve the functionality of std::optional without another object being crea...


c++stdoptional

Read More
How std::optional library handles emplace operation?...


c++emplacestdoptional

Read More
Getting an optional of a class derived from abstract class, from a class derived from abstract class...


c++inheritancepolymorphismstdoptional

Read More
std::optional::transform with std::addressof...


c++c++23stdoptional

Read More
Chain Optionals in C++...


c++c++17option-typestdoptional

Read More
Pass `std::optional::value` to `std::views::transform`...


c++c++20std-rangesstdoptional

Read More
Interaction between std::optional<std::any> and has_value()...


c++c++17stdoptionalstdany

Read More
What's the point of ref-qualified member functions in `std::optional::value`...


c++stdoptionalref-qualifier

Read More
How would a std::optional<std::nullopt_t> operate?...


c++c++17stdoptional

Read More
Forward declaration of class inside unique_ptr inside optional with default argument fails...


c++stdoptional

Read More
Why doesn't iterate over a container accessed directly through std::optional<T>::value() w...


c++algorithmc++20stdoptionalrange-based-loop

Read More
optional refence to an object: best way?...


c++referencestdoptional

Read More
BackNext