Does anyone know any implementation of a templated cache of objects?
In an application I can hardly imagine it would speed/boost up performance to store objects that apparently can be re-created (hip: since they can be automatically discarded, when the cache tops). A sw cache would require memory-fetching through associativism code, surely slower then memory allocation and constructor running (mostly memory initializations).
With the exception of manual user configuration to avoid the paging mechanism (precisely to boost performance, btw), most OS "caches" memory for you on disk... it's "paging", a form of "high-cost caching", because nothing gets thrown away, and it's done by specific HW, a sub-processing unit called Memory Management Unit...
A caching-code, in the big picture, would be slowing processes while being redundant.