banner

}

void ObjShow12(Base &obj) //以基本类Base的引用作为参数

tips

{

obj.Show();

}

void ObjShow13(Base obj) //以基本类的对象Base作为参数

{

obj.Show();

}

void ObjShow21(Der1 * pobj) //以指向Der1类的指针作为参数

{

pobj->Show();

}

void ObjShow22(Der1 &obj) //以Der1类的引用作为参数

{

obj.Show();

}

voiing替换Thing,用King替换Thing。不过,程序清单14.21包含下面的声明:

Crab nebula;

因此,Thing将被实例化为Stack,而Thing将被实例化为Stack。简而言之,模板参数Thing将被替换为声明Crab对象时被用作模板参数的模板类型。

Crab类的声明对Thing代表的模板类做了另外三个假设,即这个类包含一个push()方法和一个pop()方法,且这些方法有特定的接口。Crab类可以使用任何与Thing类型声明匹配,并包h equirectangular is that it doesn’t preserve areas or represent the earth’s surface all that well. The debate of how to best project a sphere onto a two dimensional surface has a fascinating history, and D3’s enormous collection of geographic projections shows the many ways people have attempted to