Compare commits
2 Commits
68a316354d
...
f8681441e2
| Author | SHA1 | Date | |
|---|---|---|---|
| f8681441e2 | |||
| 3f4d5b30a5 |
@@ -5,7 +5,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
cout << "Hello World!" << endl;
|
cout << "Type factory simple example" << endl;
|
||||||
|
|
||||||
struct Base {
|
struct Base {
|
||||||
virtual ~Base() = default;
|
virtual ~Base() = default;
|
||||||
@@ -35,8 +35,8 @@ int main() {
|
|||||||
auto a = factory.create ("one", 10);
|
auto a = factory.create ("one", 10);
|
||||||
auto b = factory.creator ("two") (10); // advanced API: get creator function
|
auto b = factory.creator ("two") (10); // advanced API: get creator function
|
||||||
|
|
||||||
(void)a->get();
|
std::cout << a->get() << std::endl;
|
||||||
(void)b->get();
|
std::cout << b->get() << std::endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user