ATLAS Offline Software
IsUpdater.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-2023 CERN for the benefit of the ATLAS collaboration.
4  */
13 #ifndef CXXUTILS_ISUPDATER_H
14 #define CXXUTILS_ISUPDATER_H
15 
16 
17 #include "CxxUtils/concepts.h"
18 #include <memory>
19 
20 
21 #if HAVE_CONCEPTS
22 
23 
24 namespace CxxUtils {
25 namespace detail {
26 
27 
53 template <template <class> class UPDATER>
54 concept IsUpdater = requires(UPDATER<int> x,
55  const typename UPDATER<int>::Context_t& ctx)
56 {
57  typename UPDATER<int>::Context_t;
58  { x.get() } -> std::same_as<const int&>;
59  { x.update (std::make_unique<int>(0), ctx) };
60  { x.quiescent (ctx) };
61  { x.defaultContext() } -> std::convertible_to<typename UPDATER<int>::Context_t>;
62 };
63 
64 
65 } // namespace detail
66 } // namespace CxxUtils
67 
68 
69 #endif
70 
71 
72 #endif // not CXXUTILS_ISUPDATER_H
detail
Definition: extract_histogram_tag.cxx:14
x
#define x
CxxUtils
Definition: aligned_vector.h:29
concepts.h
Compatibility helpers for using some pieces of C++20 concepts with older compilers.