摘要:
C++ mechanisms for polymorphismExplicit programmer-specified polymorphismYou can writef()such that it can operate on multiple types in any of the following ways:Preprocessing:#define f(X)((X)+=2)// (note: in real code, use a longer uppercase name for a macro!)Overloading:void f(int& x){ x +=2;}v 阅读全文
posted @ 2013-04-04 20:10
strorehouse
阅读(129)
评论(0)
推荐(0)
浙公网安备 33010602011771号