fix CXX0X std::_Select2nd no longer deriving from std::unary_function
authorMichael Andres <ma@suse.de>
Wed, 2 May 2012 11:26:06 +0000 (13:26 +0200)
committerMichael Andres <ma@suse.de>
Wed, 2 May 2012 11:31:30 +0000 (13:31 +0200)
zypp/pool/PoolTraits.h

index 0b180d4b85b752bc2bdcf4146de712eb4ad10062..37b96b72fddac0c7fbed1c9153e843ed43844d73 100644 (file)
@@ -43,6 +43,20 @@ namespace zypp
       { return pi; }
     };
 
+    /** In CXX0X std::_Select2nd does no longer derive from std::unary_function
+     */
+    template<typename _Pair>
+    struct P_Select2nd : public std::unary_function<_Pair, typename _Pair::second_type>
+    {
+      typename _Pair::second_type&
+      operator()(_Pair& __x) const
+      { return __x.second; }
+
+      const typename _Pair::second_type&
+      operator()(const _Pair& __x) const
+      { return __x.second; }
+    };
+
     ///////////////////////////////////////////////////////////////////
     //
     // CLASS NAME : PoolTraits
@@ -63,7 +77,7 @@ namespace zypp
       /** ident index */
       typedef std::tr1::unordered_multimap<sat::detail::IdType, PoolItem>
                                                         Id2ItemT;
-      typedef std::_Select2nd<Id2ItemT::value_type>     Id2ItemValueSelector;
+      typedef P_Select2nd<Id2ItemT::value_type>         Id2ItemValueSelector;
       typedef transform_iterator<Id2ItemValueSelector, Id2ItemT::const_iterator>
                                                         byIdent_iterator;