STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
range_access.h
Go to the documentation of this file.
1 // <range_access.h> -*- C++ -*-
2 
3 // Copyright (C) 2010-2013 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 // <http://www.gnu.org/licenses/>.
24 
30 #ifndef _GLIBCXX_RANGE_ACCESS_H
31 #define _GLIBCXX_RANGE_ACCESS_H 1
32 
33 #pragma GCC system_header
34 
35 #if __cplusplus >= 201103L
36 
37 namespace std _GLIBCXX_VISIBILITY(default)
38 {
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
40 
46  template<class _Container>
47  inline auto
48  begin(_Container& __cont) -> decltype(__cont.begin())
49  { return __cont.begin(); }
50 
56  template<class _Container>
57  inline auto
58  begin(const _Container& __cont) -> decltype(__cont.begin())
59  { return __cont.begin(); }
60 
66  template<class _Container>
67  inline auto
68  end(_Container& __cont) -> decltype(__cont.end())
69  { return __cont.end(); }
70 
76  template<class _Container>
77  inline auto
78  end(const _Container& __cont) -> decltype(__cont.end())
79  { return __cont.end(); }
80 
85  template<class _Tp, size_t _Nm>
86  inline _Tp*
87  begin(_Tp (&__arr)[_Nm])
88  { return __arr; }
89 
95  template<class _Tp, size_t _Nm>
96  inline _Tp*
97  end(_Tp (&__arr)[_Nm])
98  { return __arr + _Nm; }
99 
100 _GLIBCXX_END_NAMESPACE_VERSION
101 } // namespace
102 
103 #endif // C++11
104 
105 #endif // _GLIBCXX_RANGE_ACCESS_H
namespace std _GLIBCXX_VISIBILITY(default)
Definition: auto_ptr.h:36