Skip to content

Commit

Permalink
Add template keyword in CanonicalOD::IsValid to avoid most vexing parse
Browse files Browse the repository at this point in the history
cache.Swap<Ascending>(ap) was parsed as (cache.Swap)<Ascending>(ap)
Add template keyword: (cache.template Swap<Ascending>)(ap)
This behaviour (most vexing parse) is said to be the only right:
llvm/llvm-project#22385
  • Loading branch information
p-senichenkov committed Dec 23, 2024
1 parent b0e278d commit 0a9b7ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/algorithms/od/fastod/model/canonical_od.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <sstream>

#include "algorithms/od/fastod/partitions/complex_stripped_partition.h"

namespace algos::fastod {

template <bool Ascending>
Expand All @@ -11,7 +13,8 @@ CanonicalOD<Ascending>::CanonicalOD(AttributeSet const& context, model::ColumnIn

template <bool Ascending>
bool CanonicalOD<Ascending>::IsValid(std::shared_ptr<DataFrame> data, PartitionCache& cache) const {
return !(cache.GetStrippedPartition(context_, data).Swap<Ascending>(ap_.left, ap_.right));
return !(cache.GetStrippedPartition(context_, data)
.template Swap<Ascending>(ap_.left, ap_.right));
}

template <bool Ascending>
Expand Down

0 comments on commit 0a9b7ec

Please sign in to comment.