Changeset 1124 for cpp/common/util-stl.h
- Timestamp:
- 04/11/21 02:08:46 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/util-stl.h
r888 r1124 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 15Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2021 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 7 7 8 8 #include "nonstd_stl.h" 9 #include <map> 9 10 10 11 template<typename T, std::size_t N> void push_back(vector<T>& v, T(&d)[N]) … … 36 37 } 37 38 39 template<typename Key,typename Value> Value mapValueOrDefault(const std::map<Key,Value> &map, const Key& key, const Value& default_value) 40 { 41 auto found = map.find(key); 42 if (found != map.end()) 43 return found->second; 44 else 45 return default_value; 46 } 47 38 48 template<class T> class DeletingVector // deletes the elements (pointers) in destructor 39 49 {
Note: See TracChangeset
for help on using the changeset viewer.