Hacker News new | past | comments | ask | show | jobs | submit login

Hmm... Do you really need to wrap a pointer in std::optional?



It forces anyone trying to use it to contemplate the no-value case.


Replace the pointer with a value type and now you'd see why the optional is necessary.

Similarly I'd probably substitute the optional with a variant that has the actual error code. Go nuts with whatever you want here.


> Go nuts

Let's make error code optional, too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: