mirror of
https://github.com/OlafvdSpek/ctemplate.git
synced 2025-09-28 19:05:49 +08:00
Merge a00777262b
into 20474e9c91
This commit is contained in:
commit
846583ad4f
|
@ -194,21 +194,18 @@ class small_map {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator==(const iterator& other) const {
|
friend bool operator==(const iterator& a, const iterator& b) {
|
||||||
if (array_iter_ != NULL) {
|
if (a.array_iter_ != NULL) {
|
||||||
return array_iter_ == other.array_iter_;
|
return a.array_iter_ == b.array_iter_;
|
||||||
} else {
|
} else {
|
||||||
return other.array_iter_ == NULL && hash_iter_ == other.hash_iter_;
|
return b.array_iter_ == NULL && a.hash_iter_ == b.hash_iter_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator!=(const iterator& other) const {
|
friend bool operator!=(const iterator& a, const iterator& b) {
|
||||||
return !(*this == other);
|
return !(a == b);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const const_iterator& other) const;
|
|
||||||
bool operator!=(const const_iterator& other) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class small_map;
|
friend class small_map;
|
||||||
friend class const_iterator;
|
friend class const_iterator;
|
||||||
|
@ -277,16 +274,16 @@ class small_map {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator==(const const_iterator& other) const {
|
friend bool operator==(const const_iterator& a, const const_iterator& b) {
|
||||||
if (array_iter_ != NULL) {
|
if (a.array_iter_ != NULL) {
|
||||||
return array_iter_ == other.array_iter_;
|
return a.array_iter_ == b.array_iter_;
|
||||||
} else {
|
} else {
|
||||||
return other.array_iter_ == NULL && hash_iter_ == other.hash_iter_;
|
return b.array_iter_ == NULL && a.hash_iter_ == b.hash_iter_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator!=(const const_iterator& other) const {
|
friend bool operator!=(const const_iterator& a, const const_iterator& b) {
|
||||||
return !(*this == other);
|
return !(a == b);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -549,21 +546,6 @@ class small_map {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename NormalMap, int kArraySize, typename EqualKey,
|
|
||||||
typename Functor>
|
|
||||||
inline bool small_map<NormalMap, kArraySize, EqualKey,
|
|
||||||
Functor>::iterator::operator==(
|
|
||||||
const const_iterator& other) const {
|
|
||||||
return other == *this;
|
|
||||||
}
|
|
||||||
template <typename NormalMap, int kArraySize, typename EqualKey,
|
|
||||||
typename Functor>
|
|
||||||
inline bool small_map<NormalMap, kArraySize, EqualKey,
|
|
||||||
Functor>::iterator::operator!=(
|
|
||||||
const const_iterator& other) const {
|
|
||||||
return other != *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // UTIL_GTL_SMALL_MAP_H_
|
#endif // UTIL_GTL_SMALL_MAP_H_
|
||||||
|
|
Loading…
Reference in New Issue
Block a user