Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Code:
Selected Language:
Show Linenumbers:
Short link for Twitter:
HTML:

HTML view:

Copy Source | Copy HTML
  1.     template <typename T, typename Key>
  2. void FillMapByField(const std::vector<T> & AData, std::map<Key, T> & result, const TWString &Field, bool Erase = true)
  3. {
  4.     T Value;
  5.     Key KeyValue;
  6.     Value.StoreValue();
  7.     if (Erase)
  8.         result.clear();
  9.     for(std::vector<T>::const_iterator it = AData.begin(); it != AData.end(); ++it)
  10.     {
  11.         Value = (*it);
  12.         Value.GetField(Field, KeyValue);
  13.         result.insert(std::make_pair(KeyValue,(*it)));
  14.     }
  15. }




Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2012