Glossary: Software Design Patterns in C++
Simple factory
Also written: factory, factory pattern
One function that knows every class and returns the right object for a name. `create_carrier("ups")` looks up a maker lambda in the `CARRIERS` map.
Glossary: Software Design Patterns in C++
Also written: factory, factory pattern
One function that knows every class and returns the right object for a name. `create_carrier("ups")` looks up a maker lambda in the `CARRIERS` map.