|
|
120 98 |
I provide a constructor or not and the program executes the same |
|
|
ok, how would I then use a public method to retrieve private values? That's were I am stuck. |
|
|
|
|
Generically what circumstances would I be most prone to use constructors. |
CppcoreGuidlines wrote: |
---|
Note But what do we do if we are writing a program where exceptions cannot be used? First challenge that assumption; there are many anti-exceptions myths around. We know of only a few good reasons: We are on a system so small that the exception support would eat up most of our 2K or memory. We are in a hard-real-time system and we don’t have tools that guarantee us that an exception is handled within the required time. We are in a system with tons of legacy code using lots of pointers in difficult-to-understand ways (in particular without a recognizable ownership strategy) so that exceptions could cause leaks. We get fired if we challenge our manager’s ancient wisdom. |