Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
spacechild1
9mo ago
0 comments
Save
Share
So I essentially have to wrap it in something like std::optional. Well, that's certainly
one
way to write a socket class, but I'd say it's not idiomatic C++. (I have never seen a socket class being implemented like that.)
0 comments
2 comments · 1 top-level
top
newest
oldest
sgsjchs
9mo ago
· 1 in thread
You don't need optional in this case, the assignment would just destroy the old socket and immediately move the new one in its place.
spacechild1
OP
9mo ago
Well, reopening a socket implies that I have manually closed the socket, which does require an optional with your implementation.
j
/
k
navigate · click thread line to collapse