• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2024 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef BASE_RANGES_FROM_RANGE_H_
6 #define BASE_RANGES_FROM_RANGE_H_
7 
8 namespace base {
9 
10 // A marker type for constructors from a range. This is a backport of
11 // `std::from_range_t` in C++23, and will be relaced with the std version one
12 // day.
13 //
14 // https://en.cppreference.com/w/cpp/ranges/from_range
15 struct from_range_t {
16   explicit from_range_t() = default;
17 };
18 
19 // The instantiation of `from_range_t`, to be passed to constructors taking the
20 // marker type `from_range_t`.
21 constexpr inline from_range_t from_range;
22 
23 }  // namespace base
24 
25 #endif  // BASE_RANGES_FROM_RANGE_H_
26