summaryrefslogtreecommitdiff
path: root/libstdc++-v3/bits/stl_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/bits/stl_map.h')
-rw-r--r--libstdc++-v3/bits/stl_map.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/libstdc++-v3/bits/stl_map.h b/libstdc++-v3/bits/stl_map.h
index 1a3b63014dc..0b7a06d4b8b 100644
--- a/libstdc++-v3/bits/stl_map.h
+++ b/libstdc++-v3/bits/stl_map.h
@@ -31,6 +31,8 @@
#ifndef _CPP_BITS_STL_MAP_H
#define _CPP_BITS_STL_MAP_H 1
+#include <bits/concept_checks.h>
+
__STL_BEGIN_NAMESPACE
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
@@ -43,6 +45,11 @@ template <class _Key, class _Tp, class _Compare = less<_Key>,
class map {
public:
+// requirements:
+
+ __STL_CLASS_REQUIRES(_Tp, _Assignable);
+ __STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Key, _Key);
+
// typedefs:
typedef _Key key_type;
@@ -181,7 +188,9 @@ public:
iterator find(const key_type& __x) { return _M_t.find(__x); }
const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
- size_type count(const key_type& __x) const { return _M_t.count(__x); }
+ size_type count(const key_type& __x) const {
+ return _M_t.find(__x) == _M_t.end() ? 0 : 1;
+ }
iterator lower_bound(const key_type& __x) {return _M_t.lower_bound(__x); }
const_iterator lower_bound(const key_type& __x) const {
return _M_t.lower_bound(__x);
@@ -198,19 +207,19 @@ public:
return _M_t.equal_range(__x);
}
-#ifdef __STL_MEMBER_TEMPLATES
+#ifdef __STL_TEMPLATE_FRIENDS
template <class _K1, class _T1, class _C1, class _A1>
friend bool operator== (const map<_K1, _T1, _C1, _A1>&,
const map<_K1, _T1, _C1, _A1>&);
template <class _K1, class _T1, class _C1, class _A1>
friend bool operator< (const map<_K1, _T1, _C1, _A1>&,
const map<_K1, _T1, _C1, _A1>&);
-#else /* __STL_MEMBER_TEMPLATES */
+#else /* __STL_TEMPLATE_FRIENDS */
friend bool __STD_QUALIFIER
operator== __STL_NULL_TMPL_ARGS (const map&, const map&);
friend bool __STD_QUALIFIER
operator< __STL_NULL_TMPL_ARGS (const map&, const map&);
-#endif /* __STL_MEMBER_TEMPLATES */
+#endif /* __STL_TEMPLATE_FRIENDS */
};
template <class _Key, class _Tp, class _Compare, class _Alloc>