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