OSDN Git Service

2007-03-04 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / include / tr1 / utility
index 246a6fa..efe2503 100644 (file)
@@ -1,6 +1,6 @@
 // TR1 utility -*- C++ -*-
 
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 // invalidate any other reasons why the executable file might be covered by
 // the GNU General Public License.
 
-/** @file 
+/** @file tr1/utility
  *  This is a TR1 C++ Library header. 
  */
 
 #ifndef _TR1_UTILITY
 #define _TR1_UTILITY 1
 
-#include "../utility"
+#include <utility>
 
 namespace std
 {
-namespace tr1
-{
+_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
+
   template<class _Tp> class tuple_size;
   template<int _Int, class _Tp> class tuple_element;
 
@@ -47,7 +47,10 @@ namespace tr1
   template<class _Tp1, class _Tp2>
     struct tuple_size<std::pair<_Tp1, _Tp2> >
     { static const int value = 2; };
+
+  template<class _Tp1, class _Tp2>
+    const int tuple_size<std::pair<_Tp1, _Tp2> >::value;
+
   template<class _Tp1, class _Tp2>
     struct tuple_element<0, std::pair<_Tp1, _Tp2> >
     { typedef _Tp1 type; };
@@ -84,15 +87,16 @@ namespace tr1
     };
 
    template<int _Int, class _Tp1, class _Tp2>
-     typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
-     get(pair<_Tp1, _Tp2>& __in)
+     inline typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
+     get(std::pair<_Tp1, _Tp2>& __in)
      { return __pair_get<_Int>::__get(__in); }
  
    template<int _Int, class _Tp1, class _Tp2>
-     const typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
-     get(const pair<_Tp1, _Tp2>& __in)
+     inline const typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
+     get(const std::pair<_Tp1, _Tp2>& __in)
      { return __pair_get<_Int>::__const_get(__in); }
-}
+
+_GLIBCXX_END_NAMESPACE
 } 
 
 #endif