Chapter
Factory Functions
From ComputerScienceOne by Dr Chris Bourke
Concepts
- How can factory functions simplify the creation of structure instances?
"Properly creating and initializing structure instances can be a complex and tedious task. However, it is likely that we will need to repeat this operation over and over. We can simplify our task if w
- How should a copied structure avoid sharing references?
"Another common operation is to create a copy of a given structure. We will want to again ensure that everything is a deep copy so that the two structures are not sharing references. We can easily do