Skip to content

Commit

Permalink
netplay: Tweak optional.hpp usage
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Nov 12, 2024
1 parent 845dee0 commit ed6c845
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/netplay/netsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct Socket

SOCKET fd[SOCK_COUNT];
bool ready;
nonstd::optional<std::error_code> writeErrorCode;
optional<std::error_code> writeErrorCode = nullopt;
bool deleteLater;
char textAddress[40] = {};

Expand Down
4 changes: 3 additions & 1 deletion lib/netplay/netsocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <vector>

#include <nonstd/optional.hpp>
using nonstd::optional;
using nonstd::nullopt;
#include <tl/expected.hpp>

namespace net
Expand Down Expand Up @@ -158,7 +160,7 @@ struct OpenConnectionResult
void operator()(Socket* b) { if (b) { socketClose(b); } }
};
std::unique_ptr<Socket, SocketDeleter> open_socket;
nonstd::optional<std::error_code> errorCode;
optional<std::error_code> errorCode = nullopt;
std::string errorString;
};
typedef std::function<void (OpenConnectionResult&& result)> OpenConnectionToHostResultCallback;
Expand Down

0 comments on commit ed6c845

Please sign in to comment.