Skip to content

Commit 5d1d898

Browse files
committed
add requires
1 parent f919b12 commit 5d1d898

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

Framework/Core/include/Framework/ASoA.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,8 +1456,8 @@ using PresliceOptional = PresliceBase<T, PreslicePolicySorted, true>;
14561456

14571457
template <typename T>
14581458
concept is_preslice = requires(T t) {
1459-
std::same_as<decltype(t.binding), std::string>;
1460-
std::same_as<decltype(t.bindingKey), StringPair>;
1459+
requires std::same_as<decltype(t.binding), std::string>;
1460+
requires std::same_as<decltype(t.bindingKey), StringPair>;
14611461
&T::isMising;
14621462
&T::updateSliceInfo;
14631463
&T::getSliceFor;

Framework/Core/include/Framework/AnalysisHelpers.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ struct Spawns : decltype(transformBase<T>()) {
287287
template <typename T>
288288
concept is_spawns = requires(T t) {
289289
typename T::metadata;
290-
std::same_as<decltype(t.pack()), typename T::expression_pack_t>;
290+
requires std::same_as<decltype(t.pack()), typename T::expression_pack_t>;
291291
};
292292

293293
/// Policy to control index building
@@ -473,7 +473,7 @@ template <typename T>
473473
concept is_builds = requires(T t) {
474474
typename T::metadata;
475475
typename T::Key;
476-
std::same_as<decltype(t.pack()), typename T::index_pack_t>;
476+
requires std::same_as<decltype(t.pack()), typename T::index_pack_t>;
477477
};
478478

479479
/// This helper class allows you to declare things which will be created by a
@@ -572,7 +572,10 @@ struct OutputObj {
572572
};
573573

574574
template <typename T>
575-
concept is_outputobj = requires(T t) { &T::setObject; std::same_as<decltype(t.object), std::shared_ptr<typename T::obj_t>>; };
575+
concept is_outputobj = requires(T t) {
576+
&T::setObject;
577+
requires std::same_as<decltype(t.object), std::shared_ptr<typename T::obj_t>>;
578+
};
576579

577580
/// This helper allows you to fetch a Sevice from the context or
578581
/// by using some singleton. This hopefully will hide the Singleton and
@@ -593,7 +596,10 @@ struct Service {
593596
};
594597

595598
template <typename T>
596-
concept is_service = requires(T t) { std::same_as<decltype(t.service), typename T::service_t*>; &T::operator->; };
599+
concept is_service = requires(T t) {
600+
requires std::same_as<decltype(t.service), typename T::service_t*>;
601+
&T::operator->;
602+
};
597603

598604
auto getTableFromFilter(soa::is_filtered_table auto const& table, soa::SelectionVector&& selection)
599605
{
@@ -721,7 +727,11 @@ struct Partition {
721727
};
722728

723729
template <typename T>
724-
concept is_partition = requires(T t) {&T::updatePlaceholders; std::same_as<decltype(t.filter), expressions::Filter>; std::same_as<decltype(t.mFiltered), std::unique_ptr<o2::soa::Filtered<typename T::content_t>>>; };
730+
concept is_partition = requires(T t) {
731+
&T::updatePlaceholders;
732+
requires std::same_as<decltype(t.filter), expressions::Filter>;
733+
requires std::same_as<decltype(t.mFiltered), std::unique_ptr<o2::soa::Filtered<typename T::content_t>>>;
734+
};
725735
} // namespace o2::framework
726736

727737
namespace o2::soa

Framework/Core/include/Framework/Condition.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ struct Condition {
4545
template <typename T>
4646
concept is_condition = requires(T t) {
4747
typename T::type;
48-
std::same_as<T*, decltype(t.instance)>;
49-
std::same_as<std::string, decltype(t.path)>;
48+
requires std::same_as<T*, decltype(t.instance)>;
49+
requires std::same_as<std::string, decltype(t.path)>;
5050
};
5151

5252
/// Can be used to group together a number of Configurables

Framework/Core/include/Framework/Configurable.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ template <typename T, ConfigParamKind K = ConfigParamKind::kGeneric>
8484
using MutableConfigurable = Configurable<T, K, ConfigurablePolicyMutable<T, K>>;
8585

8686
template <typename T>
87-
concept is_configurable = requires(T& t) { typename T::type; std::same_as<std::string, decltype(t.name)>; &T::operator typename T::type; };
87+
concept is_configurable = requires(T& t) {
88+
typename T::type;
89+
requires std::same_as<std::string, decltype(t.name)>;
90+
&T::operator typename T::type;
91+
};
8892

8993
using ConfigurableAxis = Configurable<std::vector<double>, ConfigParamKind::kAxisSpec, ConfigurablePolicyConst<std::vector<double>, ConfigParamKind::kAxisSpec>>;
9094

0 commit comments

Comments
 (0)