Changeset 1288 for cpp/common/util-stl.h


Ignore:
Timestamp:
12/06/23 03:32:58 (17 months ago)
Author:
Maciej Komosinski
Message:

Added helper functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified cpp/common/util-stl.h

    r1130 r1288  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2023  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    1313        for (unsigned int i = 0; i < N; i++)
    1414                v.push_back(d[i]);
     15}
     16
     17template<typename T> void push_back(vector<T>& to, const vector<T>& from)
     18{
     19        for (auto &e : from)
     20                to.push_back(e);
    1521}
    1622
     
    3743}
    3844
    39 template<typename Key,typename Value> Value mapValueOrDefault(const std::map<Key,Value> &map, const Key& key, const Value& default_value)
     45template<typename Key, typename Value> Value mapValueOrDefault(const std::map<Key, Value> &map, const Key& key, const Value& default_value)
    4046{
    4147        auto found = map.find(key);
Note: See TracChangeset for help on using the changeset viewer.