This file is indexed.

/usr/include/range/v3/begin_end.hpp is in librange-v3-dev 0.3.5-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
/// \file
// Range v3 library
//
//  Copyright Eric Niebler 2013-present
//
//  Use, modification and distribution is subject to the
//  Boost Software License, Version 1.0. (See accompanying
//  file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range-v3
//

#ifndef RANGES_V3_BEGIN_END_HPP
#define RANGES_V3_BEGIN_END_HPP

#include <functional>
#include <initializer_list>
#include <iterator>
#include <utility>

#include <range/v3/range_fwd.hpp>
#include <range/v3/utility/copy.hpp>
#include <range/v3/utility/dangling.hpp>
#include <range/v3/utility/iterator_concepts.hpp>
#include <range/v3/utility/iterator_traits.hpp>
#include <range/v3/utility/iterator.hpp>
#include <range/v3/utility/static_const.hpp>

namespace ranges
{
    inline namespace v3
    {
        /// \cond
        namespace _begin_
        {
            // Poison pill for std::begin. (See the detailed discussion at
            // https://github.com/ericniebler/stl2/issues/139)
            template<typename T>
            void begin(T &) = delete;
            template<typename T>
            void begin(T const &) = delete;

            struct fn
            {
            private:
                template<typename R, std::size_t N>
                static constexpr R *impl_(R (&array)[N], int) noexcept
                {
                    return array;
                }

                // Prefer member if it returns Iterator.
                template<typename R,
                    typename I = decltype(aux::copy(std::declval<R &>().begin())),
                    CONCEPT_REQUIRES_(Iterator<I>())>
                static constexpr I impl_(R &r, int)
                RANGES_AUTO_RETURN_NOEXCEPT
                (
                    r.begin()
                )

                // Use ADL if it returns Iterator.
                template<typename R,
                    typename I = decltype(aux::copy(begin(std::declval<R &>()))),
                    CONCEPT_REQUIRES_(Iterator<I>())>
                static constexpr I impl_(R &r, long)
                RANGES_AUTO_RETURN_NOEXCEPT
                (
                    begin(r)
                )

            public:
                template<typename R>
                constexpr auto operator()(R &r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    fn::impl_(r, 42)
                )

                template<typename R>
                RANGES_DEPRECATED("Passing an rvalue to ranges::begin is deprecated.")
                constexpr auto operator()(const R &&r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    fn::impl_(r, 42)
                )

                template<typename T, typename Fn = fn>
                constexpr auto operator()(std::reference_wrapper<T> ref) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    Fn()(ref.get())
                )

                template<typename T, typename Fn = fn>
                constexpr auto operator()(ranges::reference_wrapper<T> ref) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    Fn()(ref.get())
                )
            };
        }
        /// \endcond

        /// \ingroup group-core
        /// \param r
        /// \return \c r, if \c r is an array. Otherwise, `r.begin()` if that expression is
        ///   well-formed and returns an Iterator. Otherwise, `begin(r)` if that expression
        ///   returns an Iterator.
        RANGES_INLINE_VARIABLE(_begin_::fn, begin)

        /// \cond
        namespace _end_
        {
            // Poison pill for std::end. (See the detailed discussion at
            // https://github.com/ericniebler/stl2/issues/139)
            template<typename T>
            void end(T &) = delete;
            template<typename T>
            void end(T const &) = delete;

            struct fn
            {
            private:
                template<typename R, std::size_t N>
                static constexpr R *impl_(R (&array)[N], int) noexcept
                {
                    return array + N;
                }

                // Prefer member if it returns Sentinel.
                template<typename R,
                    typename I = decltype(ranges::begin(std::declval<R &>())),
                    typename S = decltype(aux::copy(std::declval<R &>().end())),
                    CONCEPT_REQUIRES_(Sentinel<S, I>())>
                static constexpr S impl_(R &r, int)
                RANGES_AUTO_RETURN_NOEXCEPT
                (
                    r.end()
                )

                // Use ADL if it returns Sentinel.
                template<typename R,
                    typename I = decltype(ranges::begin(std::declval<R &>())),
                    typename S = decltype(aux::copy(end(std::declval<R &>()))),
                    CONCEPT_REQUIRES_(Sentinel<S, I>())>
                static constexpr S impl_(R &r, long)
                RANGES_AUTO_RETURN_NOEXCEPT
                (
                    end(r)
                )

            public:
                template<typename R>
                constexpr auto operator()(R &r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    fn::impl_(r, 42)
                )

                template<typename R>
                RANGES_DEPRECATED("Passing an rvalue to ranges::end is deprecated.")
                constexpr auto operator()(const R &&r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    fn::impl_(r, 42)
                )

                template<typename T, typename Fn = fn>
                constexpr auto operator()(std::reference_wrapper<T> ref) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    Fn()(ref.get())
                )

                template<typename T, typename Fn = fn>
                constexpr auto operator()(ranges::reference_wrapper<T> ref) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    Fn()(ref.get())
                )
            };
        }
        /// \endcond

        /// \ingroup group-core
        /// \param r
        /// \return \c r+size(r), if \c r is an array. Otherwise, `r.end()` if that expression is
        ///   well-formed and returns an Iterator. Otherwise, `end(r)` if that expression
        ///   returns an Iterator.
        RANGES_INLINE_VARIABLE(_end_::fn, end)

        /// \cond
        namespace _cbegin_
        {
            struct fn
            {
                template<typename R>
                constexpr auto operator()(R const &r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    ranges::begin(r)
                )

                template<typename R>
                RANGES_DEPRECATED("Passing an rvalue to ranges::cbegin is deprecated.")
                constexpr auto operator()(const R &&r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    ranges::begin(r)
                )
            };
        }
        /// \endcond

        /// \ingroup group-core
        /// \param r
        /// \return The result of calling `ranges::begin` with a const-qualified
        ///    reference to r.
        RANGES_INLINE_VARIABLE(_cbegin_::fn, cbegin)

        /// \cond
        namespace _cend_
        {
            struct fn
            {
                template<typename R>
                constexpr auto operator()(R const &r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    ranges::end(r)
                )

                template<typename R>
                RANGES_DEPRECATED("Passing an rvalue to ranges::cend is deprecated.")
                constexpr auto operator()(const R &&r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    ranges::end(r)
                )
            };
        }
        /// \endcond

        /// \ingroup group-core
        /// \param r
        /// \return The result of calling `ranges::end` with a const-qualified
        ///    reference to r.
        RANGES_INLINE_VARIABLE(_cend_::fn, cend)

        /// \cond
        namespace _rbegin_
        {
            struct fn
            {
            private:
                template<typename R, std::size_t N>
                static constexpr reverse_iterator<R *> impl_(R (&array)[N], int) noexcept
                {
                    return ranges::make_reverse_iterator(array + N);
                }

                // Prefer member if it returns Iterator.
                template<typename R,
                    typename I = decltype(aux::copy(std::declval<R &>().rbegin())),
                    CONCEPT_REQUIRES_(Iterator<I>())>
                static constexpr I impl_(R &r, int)
                RANGES_AUTO_RETURN_NOEXCEPT
                (
                    r.rbegin()
                )

                template<typename R,
                    typename I = decltype(ranges::begin(std::declval<R &>())),
                    typename S = decltype(ranges::end(std::declval<R &>())),
                    CONCEPT_REQUIRES_(Same<I, S>() && BidirectionalIterator<I>())>
                static constexpr reverse_iterator<I> impl_(R &r, long)
                RANGES_AUTO_RETURN_NOEXCEPT
                (
                    ranges::make_reverse_iterator(ranges::end(r))
                )

            public:
                template<typename R>
                constexpr auto operator()(R &r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    fn::impl_(r, 42)
                )

                template<typename R>
                RANGES_DEPRECATED("Passing an rvalue to ranges::rbegin is deprecated.")
                constexpr auto operator()(const R &&r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    fn::impl_(r, 42)
                )

                template<typename T, typename Fn = fn>
                constexpr auto operator()(std::reference_wrapper<T> ref) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    Fn()(ref.get())
                )

                template<typename T, typename Fn = fn>
                constexpr auto operator()(ranges::reference_wrapper<T> ref) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    Fn()(ref.get())
                )
            };
        }
        /// \endcond

        /// \ingroup group-core
        /// \param r
        /// \return `make_reverse_iterator(r+size(r))` if r is an array. Otherwise,
        ///   `r.rbegin()` if that expression is well-formed and returns an Iterator.
        ///   Otherwise, `make_reverse_iterator(ranges::end(r))` if `ranges::begin(r)`
        ///   and `ranges::end(r)` are both well-formed and have the same type that
        ///   satisfies BidirectionalIterator.
        RANGES_INLINE_VARIABLE(_rbegin_::fn, rbegin)

        /// \cond
        namespace _rend_
        {
            struct fn
            {
            private:
                template<typename R, std::size_t N>
                static constexpr reverse_iterator<R *> impl_(R (&array)[N], int) noexcept
                {
                    return ranges::make_reverse_iterator(array);
                }

                // Prefer member if it returns Sentinel.
                template<typename R,
                    typename I = decltype(ranges::rbegin(std::declval<R &>())),
                    typename S = decltype(aux::copy(std::declval<R &>().rend())),
                    CONCEPT_REQUIRES_(Sentinel<S, I>())>
                static constexpr S impl_(R &r, int)
                RANGES_AUTO_RETURN_NOEXCEPT
                (
                    r.rend()
                )

                template<typename R,
                    typename I = decltype(ranges::begin(std::declval<R &>())),
                    typename S = decltype(ranges::end(std::declval<R &>())),
                    CONCEPT_REQUIRES_(Same<I, S>() && BidirectionalIterator<I>())>
                static constexpr reverse_iterator<I> impl_(R &r, long)
                RANGES_AUTO_RETURN_NOEXCEPT
                (
                    ranges::make_reverse_iterator(ranges::begin(r))
                )

            public:
                template<typename R>
                constexpr auto operator()(R &r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    fn::impl_(r, 42)
                )

                template<typename R>
                RANGES_DEPRECATED("Passing an rvalue to ranges::rend is deprecated.")
                constexpr auto operator()(const R &&r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    fn::impl_(r, 42)
                )

                template<typename T, typename Fn = fn>
                constexpr auto operator()(std::reference_wrapper<T> ref) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    Fn()(ref.get())
                )

                template<typename T, typename Fn = fn>
                constexpr auto operator()(ranges::reference_wrapper<T> ref) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    Fn()(ref.get())
                )
            };
        }
        /// \endcond

        /// \ingroup group-core
        /// \param r
        /// \return `make_reverse_iterator(r))` if r is an array. Otherwise,
        ///   `r.rend()` if that expression is well-formed and returns a type that
        ///   satisfies `Sentinel<S, I>` where `I` is the type of `ranges::rbegin(r)`.
        ///   Otherwise, `make_reverse_iterator(ranges::begin(r))` if `ranges::begin(r)`
        ///   and `ranges::end(r)` are both well-formed and have the same type that
        ///   satisfies BidirectionalIterator.
        RANGES_INLINE_VARIABLE(_rend_::fn, rend)

        /// \cond
        namespace _crbegin_
        {
            struct fn
            {
                template<typename R>
                constexpr auto operator()(R const &r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    ranges::rbegin(r)
                )

                template<typename R>
                RANGES_DEPRECATED("Passing an rvalue to ranges::crbegin is deprecated.")
                constexpr auto operator()(const R &&r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    ranges::rbegin(r)
                )
            };
        }
        /// \endcond

        /// \ingroup group-core
        /// \param r
        /// \return The result of calling `ranges::rbegin` with a const-qualified
        ///    reference to r.
        RANGES_INLINE_VARIABLE(_crbegin_::fn, crbegin)

        /// \cond
        namespace _crend_
        {
            struct fn
            {
                template<typename R>
                constexpr auto operator()(R const &r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    ranges::rend(r)
                )

                template<typename R>
                RANGES_DEPRECATED("Passing an rvalue to ranges::crend is deprecated.")
                constexpr auto operator()(const R &&r) const
                RANGES_DECLTYPE_AUTO_RETURN_NOEXCEPT
                (
                    ranges::rend(r)
                )
            };
        }
        /// \endcond

        /// \ingroup group-core
        /// \param r
        /// \return The result of calling `ranges::rend` with a const-qualified
        ///    reference to r.
        RANGES_INLINE_VARIABLE(_crend_::fn, crend)
    }
}

#endif