From 2aaa519dfae7b0517b12cf30700d1002c13d83fa Mon Sep 17 00:00:00 2001 From: hbruintjes Date: Thu, 21 Apr 2016 16:44:37 +0200 Subject: [PATCH] Temproary workaround for clang/gcc problem: Wrap std::function in a lambda for std::sort Former-commit-id: 4148e73d6979244a48b425c80b8c44c6bcb57752 --- src/storage/bisimulation/Partition.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/storage/bisimulation/Partition.cpp b/src/storage/bisimulation/Partition.cpp index b433b70d0..b4297988d 100644 --- a/src/storage/bisimulation/Partition.cpp +++ b/src/storage/bisimulation/Partition.cpp @@ -179,7 +179,11 @@ namespace storm { template void Partition::sortRange(storm::storage::sparse::state_type beginIndex, storm::storage::sparse::state_type endIndex, std::function const& less, bool updatePositions) { - std::sort(this->states.begin() + beginIndex, this->states.begin() + endIndex, less); + //FIXME, TODO: Wrapping less argument in a lambda here, as clang and the GCC stdlib do not play nicely + // Pass 'less' directly to std::sort when this has been resolved (problem with clang 3.7, gcc 5.1) + std::sort(this->states.begin() + beginIndex, this->states.begin() + endIndex, + [&] (const storm::storage::sparse::state_type &a, storm::storage::sparse::state_type &b) { return less(a, b); } + ); if (updatePositions) { mapStatesToPositions(this->states.begin() + beginIndex, this->states.begin() + endIndex); @@ -376,4 +380,4 @@ namespace storm { } } -} \ No newline at end of file +}