OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libstdc++-v3/] [include/] [tr1/] [utility] - Blame information for rev 823

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 742 jeremybenn
// TR1 utility -*- C++ -*-
2
 
3
// Copyright (C) 2004, 2005, 2006, 2007, 2008. 2009, 2010, 2011
4
// Free Software Foundation, Inc.
5
//
6
// This file is part of the GNU ISO C++ Library.  This library is free
7
// software; you can redistribute it and/or modify it under the
8
// terms of the GNU General Public License as published by the
9
// Free Software Foundation; either version 3, or (at your option)
10
// any later version.
11
 
12
// This library is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
// GNU General Public License for more details.
16
 
17
// Under Section 7 of GPL version 3, you are granted additional
18
// permissions described in the GCC Runtime Library Exception, version
19
// 3.1, as published by the Free Software Foundation.
20
 
21
// You should have received a copy of the GNU General Public License and
22
// a copy of the GCC Runtime Library Exception along with this program;
23
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
24
// .
25
 
26
/** @file tr1/utility
27
 *  This is a TR1 C++ Library header.
28
 */
29
 
30
#ifndef _GLIBCXX_TR1_UTILITY
31
#define _GLIBCXX_TR1_UTILITY 1
32
 
33
#pragma GCC system_header
34
 
35
#include 
36
#include 
37
#include 
38
 
39
namespace std _GLIBCXX_VISIBILITY(default)
40
{
41
namespace tr1
42
{
43
_GLIBCXX_BEGIN_NAMESPACE_VERSION
44
 
45
  template
46
    class tuple_size;
47
 
48
  template
49
    class tuple_element;
50
 
51
   // Various functions which give std::pair a tuple-like interface.
52
  template
53
    struct tuple_size >
54
    { static const int value = 2; };
55
 
56
  template
57
    const int
58
    tuple_size >::value;
59
 
60
  template
61
    struct tuple_element<0, std::pair<_Tp1, _Tp2> >
62
    { typedef _Tp1 type; };
63
 
64
  template
65
    struct tuple_element<1, std::pair<_Tp1, _Tp2> >
66
    { typedef _Tp2 type; };
67
 
68
  template
69
    struct __pair_get;
70
 
71
  template<>
72
    struct __pair_get<0>
73
    {
74
      template
75
      static _Tp1& __get(std::pair<_Tp1, _Tp2>& __pair)
76
      { return __pair.first; }
77
 
78
      template
79
      static const _Tp1& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
80
      { return __pair.first; }
81
    };
82
 
83
  template<>
84
    struct __pair_get<1>
85
    {
86
      template
87
      static _Tp2& __get(std::pair<_Tp1, _Tp2>& __pair)
88
      { return __pair.second; }
89
 
90
      template
91
      static const _Tp2& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
92
      { return __pair.second; }
93
    };
94
 
95
  template
96
    inline typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
97
    get(std::pair<_Tp1, _Tp2>& __in)
98
    { return __pair_get<_Int>::__get(__in); }
99
 
100
  template
101
    inline const typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
102
    get(const std::pair<_Tp1, _Tp2>& __in)
103
    { return __pair_get<_Int>::__const_get(__in); }
104
 
105
_GLIBCXX_END_NAMESPACE_VERSION
106
}
107
}
108
 
109
#endif // _GLIBCXX_TR1_UTILITY

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.