Template Classes
box<int> ib;
box<double> db;
ib = 7;
db = 3.14;
box<int> ibtwo = 4; // can be initialized in constructor
ib = ibtwo;
int x = ib.value();
ib = 2.7; // error - cannot assign real to int
Previous slide
Next slide
Back to first slide
View graphic version