Boost logo

Boost :

From: Dory Zidon (doryzpost_at_[hidden])
Date: 2002-04-03 18:10:09

Hello people of the boost libs...
Many times we need a customized special chache for a
special solution, but many time just a simple cache
can do the trick. For those situations I wrote a
generic_cache. Like all stl containers it is generic
for all types and saves a defined amount of latest
  I was wondering if other people would like to use it
and perhaps add it to boost lib.
pragma warning(disable:4786)
#include "object_cache.h"
#include <iostream>

class Int
    Int(int m = 0) : _m(m) {};
    ~Int() {};
    int getm() const {return _m;};
    int _m;

int main(int argc, char* argv[])

    object_cache<int,Int> myCache;

    Int i1(5), i2(7) , i3(11);
    myCache[1] = i1;
    myCache[2] = i2;
    myCache[3] = i3;

    Int i4 = myCache[1];

    cout << i4.getm();

   return 0;

   Dory. - Auctions
- 1,000s of Bargains!

Boost list run by bdawes at, gregod at, cpdaniel at, john at