head	1.1;
branch	1.1.1;
access;
symbols
	RELENG_8_4:1.1.1.1.0.30
	RELENG_9_1_0_RELEASE:1.1.1.1
	RELENG_9_1:1.1.1.1.0.28
	RELENG_9_1_BP:1.1.1.1
	RELENG_8_3_0_RELEASE:1.1.1.1
	RELENG_8_3:1.1.1.1.0.26
	RELENG_8_3_BP:1.1.1.1
	RELENG_9_0_0_RELEASE:1.1.1.1
	RELENG_9_0:1.1.1.1.0.24
	RELENG_9_0_BP:1.1.1.1
	RELENG_9:1.1.1.1.0.22
	RELENG_9_BP:1.1.1.1
	RELENG_7_4_0_RELEASE:1.1.1.1
	RELENG_8_2_0_RELEASE:1.1.1.1
	RELENG_7_4:1.1.1.1.0.20
	RELENG_7_4_BP:1.1.1.1
	RELENG_8_2:1.1.1.1.0.18
	RELENG_8_2_BP:1.1.1.1
	RELENG_8_1_0_RELEASE:1.1.1.1
	RELENG_8_1:1.1.1.1.0.16
	RELENG_8_1_BP:1.1.1.1
	RELENG_7_3_0_RELEASE:1.1.1.1
	RELENG_7_3:1.1.1.1.0.14
	RELENG_7_3_BP:1.1.1.1
	RELENG_8_0_0_RELEASE:1.1.1.1
	RELENG_8_0:1.1.1.1.0.12
	RELENG_8_0_BP:1.1.1.1
	RELENG_8:1.1.1.1.0.10
	RELENG_8_BP:1.1.1.1
	RELENG_7_2_0_RELEASE:1.1.1.1
	RELENG_7_2:1.1.1.1.0.8
	RELENG_7_2_BP:1.1.1.1
	RELENG_7_1_0_RELEASE:1.1.1.1
	RELENG_7_1:1.1.1.1.0.6
	RELENG_7_1_BP:1.1.1.1
	RELENG_7_0_0_RELEASE:1.1.1.1
	RELENG_7_0:1.1.1.1.0.4
	RELENG_7_0_BP:1.1.1.1
	RELENG_7:1.1.1.1.0.2
	RELENG_7_BP:1.1.1.1
	gcc_4_2_1_20070718_SVN126787:1.1.1.1
	gcc_4_2_0_20070514_SVN124707:1.1.1.1
	FSF:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2007.05.19.01.23.20;	author kan;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2007.05.19.01.23.20;	author kan;	state Exp;
branches
	1.1.1.1.30.1;
next	;

1.1.1.1.30.1
date	2007.05.19.01.23.20;	author svnexp;	state dead;
branches;
next	1.1.1.1.30.2;

1.1.1.1.30.2
date	2013.03.28.13.01.37;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@// TR1 utility -*- C++ -*-

// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING.  If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.

// As a special exception, you may use this file as part of a free software
// library without restriction.  Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License.  This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.

/** @@file tr1/utility
 *  This is a TR1 C++ Library header. 
 */

#ifndef _TR1_UTILITY
#define _TR1_UTILITY 1

#include "../utility"

namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(tr1)

  template<class _Tp> class tuple_size;
  template<int _Int, class _Tp> class tuple_element;

   // Various functions which give std::pair a tuple-like interface.
  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; };
 
  template<class _Tp1, class _Tp2>
    struct tuple_element<1, std::pair<_Tp1, _Tp2> >
    { typedef _Tp2 type; };
 

  template<int _Int> struct __pair_get;

  template<>
    struct __pair_get<0>
    {
      template<typename _Tp1, typename _Tp2>
      static _Tp1& __get(std::pair<_Tp1, _Tp2>& __pair)
      { return __pair.first; }

      template<typename _Tp1, typename _Tp2>
      static const _Tp1& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
      { return __pair.first; }
    };

  template<>
    struct __pair_get<1>
    {
      template<typename _Tp1, typename _Tp2>
      static _Tp2& __get(std::pair<_Tp1, _Tp2>& __pair)
      { return __pair.second; }

      template<typename _Tp1, typename _Tp2>
      static const _Tp2& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
      { return __pair.second; }
    };

   template<int _Int, class _Tp1, class _Tp2>
     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>
     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
@


1.1.1.1
log
@GCC 4.2.0 release C++ standard library and runtime support code.
@
text
@@


1.1.1.1.30.1
log
@file utility was added on branch RELENG_8_4 on 2013-03-28 13:01:37 +0000
@
text
@d1 102
@


1.1.1.1.30.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 102
// TR1 utility -*- C++ -*-

// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING.  If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.

// As a special exception, you may use this file as part of a free software
// library without restriction.  Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License.  This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.

/** @@file tr1/utility
 *  This is a TR1 C++ Library header. 
 */

#ifndef _TR1_UTILITY
#define _TR1_UTILITY 1

#include "../utility"

namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(tr1)

  template<class _Tp> class tuple_size;
  template<int _Int, class _Tp> class tuple_element;

   // Various functions which give std::pair a tuple-like interface.
  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; };
 
  template<class _Tp1, class _Tp2>
    struct tuple_element<1, std::pair<_Tp1, _Tp2> >
    { typedef _Tp2 type; };
 

  template<int _Int> struct __pair_get;

  template<>
    struct __pair_get<0>
    {
      template<typename _Tp1, typename _Tp2>
      static _Tp1& __get(std::pair<_Tp1, _Tp2>& __pair)
      { return __pair.first; }

      template<typename _Tp1, typename _Tp2>
      static const _Tp1& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
      { return __pair.first; }
    };

  template<>
    struct __pair_get<1>
    {
      template<typename _Tp1, typename _Tp2>
      static _Tp2& __get(std::pair<_Tp1, _Tp2>& __pair)
      { return __pair.second; }

      template<typename _Tp1, typename _Tp2>
      static const _Tp2& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
      { return __pair.second; }
    };

   template<int _Int, class _Tp1, class _Tp2>
     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>
     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
@


