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