Merge branch 'master' into jgrpp
# Conflicts: # projects/openttd_vs140.vcxproj.filters # projects/openttd_vs141.vcxproj.filters # projects/openttd_vs142.vcxproj.filters # src/base_consist.h # src/company_base.h # src/newgrf_config.cpp # src/newgrf_config.h # src/openttd.cpp # src/saveload/saveload.cpp # src/saveload/saveload.h # src/saveload/station_sl.cpp # src/settings.cpp # src/signs_base.h # src/string.cpp # src/string_func.h # src/table/misc_settings.ini # src/table/settings.h.preamble # src/town_cmd.cpp # src/vehicle.cpp # src/vehicle_cmd.cpp # src/video/cocoa/cocoa_v.mm # src/video/null_v.cpp
This commit is contained in:
@@ -11,40 +11,26 @@
|
||||
#define SMALLMAP_TYPE_HPP
|
||||
|
||||
#include "smallvec_type.hpp"
|
||||
#include <utility>
|
||||
|
||||
/**
|
||||
* Simple pair of data. Both types have to be POD ("Plain Old Data")!
|
||||
* @tparam T Key type.
|
||||
* @tparam U Value type.
|
||||
*/
|
||||
template <typename T, typename U>
|
||||
struct SmallPair {
|
||||
T first;
|
||||
U second;
|
||||
|
||||
/** Initializes this Pair with data */
|
||||
inline SmallPair(const T &first, const U &second) : first(first), second(second) { }
|
||||
SmallPair() = default;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of simple mapping class. Both types have to be POD ("Plain Old Data")!
|
||||
* It has inherited accessors from SmallVector().
|
||||
* Implementation of simple mapping class.
|
||||
* It has inherited accessors from std::vector().
|
||||
* @tparam T Key type.
|
||||
* @tparam U Value type.
|
||||
* @tparam S Unit of allocation.
|
||||
*
|
||||
* @see SmallVector
|
||||
* @see std::vector
|
||||
*/
|
||||
template <typename T, typename U>
|
||||
struct SmallMap : std::vector<SmallPair<T, U> > {
|
||||
typedef ::SmallPair<T, U> Pair;
|
||||
struct SmallMap : std::vector<std::pair<T, U> > {
|
||||
typedef std::pair<T, U> Pair;
|
||||
typedef Pair *iterator;
|
||||
typedef const Pair *const_iterator;
|
||||
|
||||
/** Creates new SmallMap. Data are initialized in SmallVector constructor */
|
||||
/** Creates new SmallMap. Data are initialized in std::vector constructor */
|
||||
inline SmallMap() { }
|
||||
/** Data are freed in SmallVector destructor */
|
||||
/** Data are freed in std::vector destructor */
|
||||
inline ~SmallMap() { }
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user