summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-04-15 13:05:05 (GMT)
committerBrad King <brad.king@kitware.com>2005-04-15 13:05:05 (GMT)
commitdf994e53fed180c28d154458b0a1947aa9cd5ac5 (patch)
tree0fc09ef2853a0d015041c8d1c8d38003282da169
parent7f706ecc984abc81de62baa85892ecca81375bf7 (diff)
downloadCMake-df994e53fed180c28d154458b0a1947aa9cd5ac5.zip
CMake-df994e53fed180c28d154458b0a1947aa9cd5ac5.tar.gz
CMake-df994e53fed180c28d154458b0a1947aa9cd5ac5.tar.bz2
COMP: Replacing _Select1st with a specialized hash_select1st that avoids requiring the stl pair to have first_type defined. The old HP STL does not define first_type and second_type in its pair.
-rw-r--r--Source/kwsys/hash_map.hxx.in11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/kwsys/hash_map.hxx.in b/Source/kwsys/hash_map.hxx.in
index a4dfa24..d0ff1bd 100644
--- a/Source/kwsys/hash_map.hxx.in
+++ b/Source/kwsys/hash_map.hxx.in
@@ -58,10 +58,11 @@ namespace @KWSYS_NAMESPACE@
{
// select1st is an extension: it is not part of the standard.
-template <class _Pair>
-struct _Select1st : public kwsys_stl::unary_function<_Pair, typename _Pair::first_type>
+template <class T1, class T2>
+struct hash_select1st:
+ public kwsys_stl::unary_function<kwsys_stl::pair<T1, T2>, T1>
{
- const typename _Pair::first_type& operator()(const _Pair& __x) const
+ const T1& operator()(const kwsys_stl::pair<T1, T2>& __x) const
{ return __x.first; }
};
@@ -83,7 +84,7 @@ class hash_map
{
private:
typedef hashtable<kwsys_stl::pair<const _Key,_Tp>,_Key,_HashFcn,
- _Select1st<kwsys_stl::pair<const _Key,_Tp> >,_EqualKey,_Alloc> _Ht;
+ hash_select1st<const _Key,_Tp>,_EqualKey,_Alloc> _Ht;
_Ht _M_ht;
public:
@@ -276,7 +277,7 @@ class hash_multimap
{
private:
typedef hashtable<kwsys_stl::pair<const _Key, _Tp>, _Key, _HashFcn,
- _Select1st<kwsys_stl::pair<const _Key, _Tp> >, _EqualKey, _Alloc>
+ hash_select1st<const _Key, _Tp>, _EqualKey, _Alloc>
_Ht;
_Ht _M_ht;