|
OpenTTD Source
1.10.0-RC1
|
Simple vector class that allows allocating an item without the need to copy this->data needlessly. More...
Go to the source code of this file.
Functions | |
| template<typename T > | |
| bool | include (std::vector< T > &vec, const T &item) |
| Helper function to append an item to a vector if it is not already contained Consider using std::set, std::unordered_set or std::flat_set in new code. More... | |
| template<typename T > | |
| int | find_index (std::vector< T > const &vec, T const &item) |
| Helper function to get the index of an item Consider using std::set, std::unordered_set or std::flat_set in new code. More... | |
Simple vector class that allows allocating an item without the need to copy this->data needlessly.
Definition in file smallvec_type.hpp.
| int find_index | ( | std::vector< T > const & | vec, |
| T const & | item | ||
| ) |
Helper function to get the index of an item Consider using std::set, std::unordered_set or std::flat_set in new code.
| vec | A reference to the vector to be extended |
| item | Reference to the item to be search for |
Definition at line 45 of file smallvec_type.hpp.
Referenced by BuildCargoTranslationMap(), NetworkContentListWindow::FilterContentList(), GetReverseRailTypeTranslation(), VehicleGroupWindow::SelectGroup(), NetworkContentListWindow::SortContentList(), and NewGRFWindow::TagNameFilter().
|
inline |
Helper function to append an item to a vector if it is not already contained Consider using std::set, std::unordered_set or std::flat_set in new code.
| vec | A reference to the vector to be extended |
| item | Reference to the item to be copy-constructed if not found |
Definition at line 28 of file smallvec_type.hpp.
Referenced by AddAnimatedTile(), ClientNetworkContentSocketHandler::AddCallback(), Hotkey::AddKeycode(), RefitWindow::BuildRefitList(), CheckSubsidised(), DeliverGoodsToIndustry(), GetBestFittingSubType(), GetVehicleSet(), NetworkContentDownloadStatusWindow::OnDownloadProgress(), ClientNetworkContentSocketHandler::ReverseLookupTreeDependency(), UpdateRoadVehPowerProc(), and UpdateTrainPowerProc().