Most is taken from Ulrich Breymann: „C++ Einführung und professionelle Programmierung“ which page
Pass and return primitives as value to and from functions
Pass objects as const reference to functions and omit const only when the function is designed to modify the object
Return objects which are attributes of the class as const reference and objects wich are not class attributes (especially stack and heap objects) as value!
Prefer references to pointers
Encapsulate new and delete in the constructor and destructor of a class
Always declare constant primitives and objects with const
Cookies helfen bei der Bereitstellung von Inhalten. Diese Website verwendet Cookies. Mit der Nutzung der Website erklären Sie sich damit einverstanden, dass Cookies auf Ihrem Computer gespeichert werden. Außerdem bestätigen Sie, dass Sie unsere Datenschutzerklärung gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website. Weitere Information
becki/linux/cpp.1244440888.txt.gz · Zuletzt geändert: 2009-06-08 06:01 von becki