Skip to content

Proof of concept of a flexible system for reusing static containers.

License

Notifications You must be signed in to change notification settings

bryanchacosky/static_reuse_container.cs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

static_reuse_container.cs

C# snippet of a flexible system for reusing static containers. In the current project, it's frequent that we have static containers in individual classes used for queries -- preventing the need to allocate/deallocate containers each frame -- but these containers are manually managed and static in the class. static_reuse_container<T> creates an easier to manage approach and shares containers by type when available.

usage

static void Main () {
    using (var reuse_container = static_reuse_container<int>.get_instance()) {
        reuse_container.Add(1);
        reuse_container.Add(2);
        reuse_container.Add(3);
        // ...
    }
}

About

Proof of concept of a flexible system for reusing static containers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages