Added bad and good example to NR.5 in CppCoreGuidelines.md (#1401)
* Added bad and goof example to NR.5 in CppCoreGuidelines.md Added bad and good example to NR.5 Don’t: Don’t do substantive work in a constructor; instead use two-phase initialization. I think it could be suitable. * adjusted coding style * removed extra space * removed one more whitespace * removed spaces before note to make it a blank line * made Cleanup method from bad example return void * some changes after review comments - removed try catch - removed defaulted dtor - changed int to size_t, removed check for even. - Expects() for invariant check - typo * spell check adjustment * moved comment up for met the line length * changed variablename in good example ... they were named same after removed the try catch scope * changed afer comments - changed check_size() function to a static member function - fixed comment mentioning the default contract violation behavior.pull/1412/head
parent
0f57785d2b
commit
385199cc90
Loading…
Reference in New Issue