Content deleted Content added
RobinHood70 (talk | contribs) m Rm "IVSR" references added by an IP that add nothing to the code |
→C#: typo |
||
Line 77:
The following shows the basic code of the object pool design pattern implemented using C#. For brevity the properties of the classes are declared using C# 3.0 automatically implemented property syntax. These could be replaced with full property definitions for earlier versions of the language. Pool is shown as a static class, as it's unusual for multiple pools to be required. However, it's equally acceptable to use instance classes for object pools.
<source lang="csharp">
namespace
{
// The PooledObject class is the type that is expensive or slow to instantiate,
|