c++ tips , allocations , operator=() , const , exceptions , book list , more

Channel:
Subscribers:
144
Published on ● Video Link: https://www.youtube.com/watch?v=iny_OmvoT0c



Duration: 1:25
89 views
0


book lists , c++ , OOD , graphics programming c++ ,
windows API a c only book .

to clarify the teaser question at the end of the video.
if( ! cin ) and if( cin ) are both valid statements.
thus , over loading operator!() isn't the answer.
keep on thinking .

const use , if I did not already say:
overload operator+() and it is obvious that both the LHS and RHS
arguments should remain un-changed , both LHS and RHS arguments should be const , so the Caller's passed in arguents will be un-changed , before\during\after the call to operator+() .

operator+=() by it's very name , suggests that the LHS Will be modified( assigned= ) a\the result . Thus , RHS should be const
and the LHS should remain as variable . logically , this all seems reasonable . The caller should expect the RHS argument be un-changed , and that the LHS argument will be\get updated.







Tags:
c++
cpp
tips
c++ tips