ned14 / status-code

Proposed SG14 status_code for the C++ standard
Other
64 stars 13 forks source link

swap member function for status_code_domain::string_ref #1

Closed jwtowner closed 6 years ago

jwtowner commented 6 years ago

Hi. I have one item of critique currently. The assignment operators for status_code_domain::string_ref can't handle self-assignment nor does the copy-assignment operator provide strong exception safety. If string_ref gains a swap member function, these assignment operators can be rewritten using the copy/move-swap idiom. For efficiency, probably want to add the swap operation to _thunk_op.