OpenTTD Source
12.0-beta2
|
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 44 of file smallvec_type.hpp.
Referenced by NetworkContentListWindow::FilterContentList(), GetReverseRailTypeTranslation(), VehicleGroupWindow::SelectGroup(), and NetworkContentListWindow::SortContentList().
|
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 27 of file smallvec_type.hpp.
Referenced by AddAnimatedTile(), ClientNetworkContentSocketHandler::AddCallback(), ScenarioScanner::AddFile(), Hotkey::AddKeycode(), RefitWindow::BuildRefitList(), CheckSubsidised(), DeliverGoodsToIndustry(), GetBestFittingSubType(), GetVehicleSet(), NetworkContentDownloadStatusWindow::OnDownloadProgress(), ClientNetworkContentSocketHandler::ReverseLookupTreeDependency(), UpdateRoadVehPowerProc(), and UpdateTrainPowerProc().