r/learncpp • u/vgordievskiy • Mar 09 '21
How to improve it?
;
;
SResp
boost::optional<std::string>
int
How to improve this code?
10
Upvotes
r/learncpp • u/vgordievskiy • Mar 09 '21
;
;
SResp
boost::optional<std::string>
int
How to improve this code?
View all comments
2
u/vgordievskiy Mar 10 '21
The answer is: at the line "return response.m_msg;" the compiler invokes the copy constructor for the std::string.