Update of /cvsroot/boost/boost/boost/bimap/relation/support
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14557/relation/support

Modified Files:
        get.hpp is_tag_of_member_at.hpp member_with_tag.hpp 
        value_type_of.hpp 
Log Message:
added info support

Index: get.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/bimap/relation/support/get.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- get.hpp     31 May 2007 07:01:34 -0000      1.3
+++ get.hpp     4 Jun 2007 17:47:38 -0000       1.4
@@ -22,6 +22,9 @@
 
 #include <boost/bimap/relation/detail/access_builder.hpp>
 
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/is_const.hpp>
 
 #ifdef BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
 
@@ -99,12 +102,23 @@
 BOOST_BIMAP_SYMMETRIC_ACCESS_IMPLEMENTATION_BUILDER
 (
     get,
-    Relation,
-    rel,
-    return rel.get_left(),
-    return rel.get_right()
+    SymmetricType,
+    st,
+    return st.get_left(),
+    return st.get_right()
 )
 
+namespace detail {
+
+template< class SymmetricType >
+BOOST_DEDUCED_TYPENAME result_of::get<
+    ::boost::bimaps::relation::member_at::info, SymmetricType >::type
+get(::boost::bimaps::relation::member_at::info, SymmetricType & rel)
+{
+    return rel.info;
+}
+
+} // namespace detail
 
 // Interface
 //----------------------------------------------------------------------------
@@ -114,6 +128,7 @@
     get
 )
 
+
 } // namespace support
 } // namespace relation
 } // namespace bimaps

Index: is_tag_of_member_at.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/bimap/relation/support/is_tag_of_member_at.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- is_tag_of_member_at.hpp     25 May 2007 01:07:08 -0000      1.1
+++ is_tag_of_member_at.hpp     4 Jun 2007 17:47:38 -0000       1.2
@@ -140,6 +140,35 @@
 > :
     ::boost::mpl::true_ {};
 
+
+// Metafunction is_tag_of_member_at_info
+// Easiear metaprogramming
+
+template
+<
+    class Tag,
+    class Relation,
+    class Enable = void
+>
+struct is_tag_of_member_at_info :
+    ::boost::mpl::false_ {};
+
+template< class Tag, class Relation >
+struct is_tag_of_member_at_info
+<
+    Tag, Relation,
+    BOOST_DEDUCED_TYPENAME enable_if
+    <
+        is_same
+        <
+            BOOST_DEDUCED_TYPENAME member_with_tag<Tag,Relation>::type,
+            member_at::info
+        >
+
+    >::type
+> :
+    ::boost::mpl::true_ {};
+
 } // namespace support
 } // namespace relation
 } // namespace bimaps

Index: member_with_tag.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/bimap/relation/support/member_with_tag.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- member_with_tag.hpp 25 May 2007 01:07:08 -0000      1.1
+++ member_with_tag.hpp 4 Jun 2007 17:47:38 -0000       1.2
@@ -91,6 +91,16 @@
     typedef member_at::right type;
 };
 
+template< class Relation >
+struct member_with_tag
+<
+    BOOST_DEDUCED_TYPENAME member_at::info, Relation, void
+>
+{
+    typedef member_at::info type;
+};
+
+
 template< class Tag, class Relation >
 struct member_with_tag
 <
@@ -136,6 +146,27 @@
     typedef member_at::right type;
 };
 
+template< class Tag, class Relation >
+struct member_with_tag
+<
+    Tag, Relation,
+    BOOST_DEDUCED_TYPENAME enable_if
+    <
+        mpl::and_
+        <
+            mpl::not_< is_same<Tag,member_at::info> >,
+            is_same
+            <
+                Tag,
+                BOOST_DEDUCED_TYPENAME Relation::info_tag
+            >
+        >
+
+    >::type
+>
+{
+    typedef member_at::info type;
+};
 
 } // namespace support
 } // namespace relation

Index: value_type_of.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/bimap/relation/support/value_type_of.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- value_type_of.hpp   27 May 2007 05:40:25 -0000      1.2
+++ value_type_of.hpp   4 Jun 2007 17:47:39 -0000       1.3
@@ -61,6 +61,26 @@
     right_value_type
 )
 
+// Add support for info tags to value_type_of
+
+template< class Tag, class SymmetricType >
+struct value_type_of
+<
+    Tag, SymmetricType,
+    BOOST_DEDUCED_TYPENAME enable_if
+    <
+        ::boost::bimaps::relation::support::is_tag_of_member_at_info
+        <
+            Tag,
+            SymmetricType
+        >
+
+    >::type
+>
+{
+    typedef BOOST_DEDUCED_TYPENAME SymmetricType::info_type type;
+};
+
 } // namespace support
 } // namespace relation
 } // namespace bimaps


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to