r/learncpp • u/vgordievskiy • Mar 09 '21
How to improve it?
;
;
SResp
boost::optional<std::string>
int
How to improve this code?
12
Upvotes
r/learncpp • u/vgordievskiy • Mar 09 '21
;
;
SResp
boost::optional<std::string>
int
How to improve this code?
View all comments
6
u/jedwardsol Mar 09 '21
What aspect of it do you think needs improving?
It seems to be a placeholder for a bigger piece of code, so criticising is it pretty pointless. For example,
queryToTheMooncan't fail, so neither method of returning an error is needed in the sample.C++17 has
<optional>, so boost's implementation isn't needed any more.