.. _program_listing_file_include_flamegpu_util_StringPair.h: Program Listing for File StringPair.h ===================================== |exhale_lsh| :ref:`Return to documentation for file ` (``include/flamegpu/util/StringPair.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef INCLUDE_FLAMEGPU_UTIL_STRINGPAIR_H_ #define INCLUDE_FLAMEGPU_UTIL_STRINGPAIR_H_ #include #include #include #include namespace flamegpu { namespace util { typedef std::pair StringPair; template struct PairCompare { bool operator() (const std::pair& lhs, const std::pair& rhs) const { if (lhs.first == rhs.first) return lhs.second < rhs.second; return lhs.first < rhs.first; } }; typedef PairCompare StringPairCompare; template struct PairHash { size_t operator()(const std::pair& k) const { return std::hash()(k.first) ^ (std::hash()(k.second) << 1); } }; typedef PairHash StringPairHash; template using PairMap = std::map, T, PairCompare>; template using StringPairMap = PairMap; template using PairUnorderedMap = std::unordered_map, T, PairHash>; template using StringPairUnorderedMap = PairUnorderedMap; } // namespace util } // namespace flamegpu #endif // INCLUDE_FLAMEGPU_UTIL_STRINGPAIR_H_