userver
C++ Async Framework
Loading...
Searching...
No Matches
recentperiod_detail.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/utils/statistics/recentperiod_detail.hpp
4
/// @brief RecentPeriod template type traits and concepts
5
6
USERVER_NAMESPACE_BEGIN
7
8
namespace
utils
::
statistics
::detail {
9
10
// Detect if the result type provides Add(Counter, Duration, Duration) function
11
template
<
typename
Result,
typename
Counter,
typename
Duration>
12
concept
ResultWantsAddFunction =
requires
(Result& r, Counter c, Duration d) { r.Add(c, d, d); };
13
14
// Detect if a counter can be added to the result
15
template
<
typename
Result,
typename
Counter>
16
concept
ResultCanUseAddAssign =
requires
(Result& r,
const
Counter& c) { r += c; };
17
18
// Detect if a Counter provides a Reset function
19
template
<
typename
Counter>
20
concept
CanReset =
requires
(Counter& c) { c.Reset(); };
21
22
}
// namespace utils::statistics::detail
23
24
USERVER_NAMESPACE_END
userver
utils
statistics
recentperiod_detail.hpp
Generated on Thu May 21 2026 16:16:03 for userver by
Doxygen
1.13.2