Sometimes, the creation of an new Instance is very slow. Therefore this Lazy-Constructor could be used.
Instead of creating a new Instance, it looks for a not used and returns that Instance. By returning
the unused Instance it is marked as used. After the usage the instance could marked as unused again.
If there is no unused Instance available an new Instance is created.
To utilize the Lazy-Constructor a specific create-instance method and a compare function is required.
Sometimes, the creation of an new Instance is very slow. Therefore this Lazy-Constructor could be used. Instead of creating a new Instance, it looks for a not used and returns that Instance. By returning the unused Instance it is marked as used. After the usage the instance could marked as unused again. If there is no unused Instance available an new Instance is created.
To utilize the Lazy-Constructor a specific create-instance method and a compare function is required.
Export
Template
Type of the Instance