SF patch 120

SF #120 The ExpireLRUCache does not compile with a tuple as key on
Visual Studio 2010
https://sourceforge.net/p/poco/patches/120/
This commit is contained in:
aleks-f 2012-12-02 20:53:27 -06:00
parent 134558f926
commit a54c34e7d0

View File

@ -82,8 +82,10 @@ public:
void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args) void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args)
{ {
Timestamp now; Timestamp now;
IndexIterator it = _keyIndex.insert(typename TimeIndex::value_type(now, args.key())); typename TimeIndex::value_type tiValue(now, args.key());
std::pair<Iterator, bool> stat = _keys.insert(typename Keys::value_type(args.key(), it)); IndexIterator it = _keyIndex.insert(tiValue);
typename Keys::value_type kValue(args.key(), it);
std::pair<Iterator, bool> stat = _keys.insert(kValue);
if (!stat.second) if (!stat.second)
{ {
_keyIndex.erase(stat.first->second); _keyIndex.erase(stat.first->second);