mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Template example class should have public method so it can get called externally.
This commit is contained in:
parent
cea52ca434
commit
47d3cea47e
@ -445,6 +445,7 @@ int main () {
|
|||||||
// define a class or function that takes a type parameter:
|
// define a class or function that takes a type parameter:
|
||||||
template<class T>
|
template<class T>
|
||||||
class Box {
|
class Box {
|
||||||
|
public:
|
||||||
// In this class, T can be used as any other type.
|
// In this class, T can be used as any other type.
|
||||||
void insert(const T&) { ... }
|
void insert(const T&) { ... }
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user