Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
7jjjjjjj
9mo ago
0 comments
Save
Share
With destructive moves, you can end an object's lifetime whenever you want.
0 comments
3 comments · 1 top-level
top
newest
oldest
spacechild1
9mo ago
· 2 in thread
How would I use such a socket class as a member variable? How do I reopen the socket?
sgsjchs
9mo ago
Reopen by constructing and assigning a new socket.
spacechild1
9mo ago
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.)
1 more reply
j
/
k
navigate · click thread line to collapse