ATLAS Offline Software
Control
CxxUtils
CxxUtils
ranges.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
/*
3
* Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
4
*/
15
#ifndef CXXUTILS_RANGES_H
16
#define CXXUTILS_RANGES_H
17
18
19
#include <ranges>
20
21
22
namespace
CxxUtils
{
23
24
26
template
<
class
RANGE,
class
T>
27
concept
InputRangeOverT
=
28
std::ranges::input_range<RANGE> &&
29
std::convertible_to<std::ranges::range_value_t<RANGE>, T>;
30
31
32
#if __cpp_lib_ranges_to_container
33
// If we're using C++23, just take the library version.
34
using
std::ranges::to
;
35
#else
36
37
// Simplified version of C++23 to().
38
template
<
class
CONT,
class
RANGE>
39
CONT
to
(RANGE&&
r
)
40
{
41
return
CONT (
std::ranges::begin
(
r
),
std::ranges::end
(
r
));
42
}
43
44
#endif
45
46
}
// namespace CxxUtils
47
48
49
#endif // not CXXUTILS_RANGES_H
beamspotman.r
def r
Definition:
beamspotman.py:676
PlotCalibFromCool.begin
begin
Definition:
PlotCalibFromCool.py:94
mergePhysValFiles.end
end
Definition:
DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
CxxUtils::InputRangeOverT
concept InputRangeOverT
Concept for an input range over a given type.
Definition:
ranges.h:27
CxxUtils
Definition:
aligned_vector.h:29
CxxUtils::to
CONT to(RANGE &&r)
Definition:
ranges.h:39
Generated on Thu Nov 7 2024 21:24:24 for ATLAS Offline Software by
1.8.18