DenseMapPair
主要组成部分
DenseMapPair() {}DenseMapPair(const KeyT &Key, const ValueT &Value) : std::pair<KeyT, ValueT>(Key, Value) {}DenseMapPair(KeyT &&Key, ValueT &&Value) : std::pair<KeyT, ValueT>(std::move(Key), std::move(Value)) {}
template <typename AltKeyT, typename AltValueT> DenseMapPair(AltKeyT &&AltKey, AltValueT &&AltValue, typename std::enable_if< std::is_convertible<AltKeyT, KeyT>::value && std::is_convertible<AltValueT, ValueT>::value>::type * = 0) : std::pair<KeyT, ValueT>(std::forward<AltKeyT>(AltKey), std::forward<AltValueT>(AltValue)) {}template <typename AltPairT> DenseMapPair(AltPairT &&AltPair, typename std::enable_if<std::is_convertible< AltPairT, std::pair<KeyT, ValueT>>::value>::type * = 0) : std::pair<KeyT, ValueT>(std::forward<AltPairT>(AltPair)) {}
KeyT &getFirst() { return std::pair<KeyT, ValueT>::first; } const KeyT &getFirst() const { return std::pair<KeyT, ValueT>::first; } ValueT &getSecond() { return std::pair<KeyT, ValueT>::second; } const ValueT &getSecond() const { return std::pair<KeyT, ValueT>::second; }
总结
Last updated