python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Using std::nullopt as a default value for an std::optional argument in C++17
This is a standard / good coding practice question.
I've recently started using std::optional in my codebase. I think it's great (and verbose) for specifying an argument that's optional, so long as a ...
heothesennoc
Votes: 0
Answers: 1
Is there any safe way to derive the offset of a T inside a std::optional<T>?
Given a std::optional<T> is it possible to derive the address of the std::optional<T> from the address of the T?
possible implementation:
template<typename T>
struct myoptional
{ ...
Frank Puck
Votes: 0
Answers: 1
What are monadic bind and monadic return for C++23 optional?
C++23 std::optional is finally getting some very useful additions.
Since my knowledge of FP is very primitive I am wondering what is the syntax for the following two operations(that according to my go...
NoSenseEtAl
Votes: 0
Answers: 3
Assigning values to std::array of std::optional objects
I am trying to fill a std::array of std::optional objects as below.
class MyClass
{
private:
int distance;
MyClass(int x, int y);
friend class MasterClass;
};
MyClass::MyClass(int x, i...
TeenyTinySparkles
Votes: 0
Answers: 1