MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / include

Function include

src/core/container_func.hpp:24–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 */
23template <typename Container>
24inline bool include(Container &container, typename Container::const_reference &item)
25{
26 const bool is_member = std::ranges::find(container, item) != container.end();
27 if (!is_member) container.emplace_back(item);
28 return is_member;
29}
30
31/**
32 * Helper function to get the index of an item

Callers 12

RebuildMethod · 0.85
CmdConvertRailFunction · 0.85
CheckSubsidisedFunction · 0.85
GetVehicleSetFunction · 0.85
DeliverGoodsToIndustryFunction · 0.85
GetBestFittingSubTypeFunction · 0.85
BuildRefitListMethod · 0.85
CmdConvertRoadFunction · 0.85
AddFileMethod · 0.85
AddCallbackMethod · 0.85

Calls 2

findFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected