Adivce from the father of C++III
2007-03-18 13:24
507 查看
[1] Be suspicious of non-const reference arguments,if you want the function to modify its arguments,use pointers and value return instead;
[2] Use const reference arguments when you need to minimize copying of arguments;
[3] Use const extensively and consisiently;
[4] Avoid macros;
[5] Avoid unspecified numbers of arguments;
[6] Don't return pointers or references to local variables;
[7] Use overloading when functions perform conceptually the same task on different types;
[8] When overloading on integers,provide functions to eliminate common ambiguities;
[9] When considering the use of a pointer to function,consider whether a virtual function of a template would be a better alternative;
[10]If you must use macros,use ugly names with lots of capital letters
[2] Use const reference arguments when you need to minimize copying of arguments;
[3] Use const extensively and consisiently;
[4] Avoid macros;
[5] Avoid unspecified numbers of arguments;
[6] Don't return pointers or references to local variables;
[7] Use overloading when functions perform conceptually the same task on different types;
[8] When overloading on integers,provide functions to eliminate common ambiguities;
[9] When considering the use of a pointer to function,consider whether a virtual function of a template would be a better alternative;
[10]If you must use macros,use ugly names with lots of capital letters
相关文章推荐
- Adivce from the father of C++II
- Adivce from the father of C++
- Adivce from the father of C++
- Adivce from the father of C++
- recompiled header file is from a previous version of the compiler, or the precompiled header is C++
- C++: 为什么我们一般都要将函数的声明和定义分开?(separate the declaration of function from its definition)
- 改写the father of c++ 写的计算器,只有源代码
- How do you copy the contents of an array to a std::vector in C++ without looping? (From stack over flow)
- Pick two points at random from the interior of a unit square, what is the expected distance between them?
- Genymotion提示To find out the cause of the problem,start the virtual device from VirtualBox
- The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make s
- Actor::updateMassFromShapes: Compute mesh inertia tensor failed for one of the actor's mesh shapes!
- Inside The C++ Object Model ---- The Semantics of Data
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
- Using the WebBrowser Control from C/C++ (From MSDN)
- 174. 删除链表中倒数第n个节点 (remove-nth-node-from-end-of-list)(c++)----lintcode面试题之链表
- MS Bigdata HDInsight -Process, analyze, and gain new insights from big data using the power of Apache Hadoop
- P26 (**) Generate the combinations of K distinct objects chosen from the N elements of a list.
- The effective memory management of C++
- The Usage of Lambda and Heap in the C++ STL