Skip to content

Commit

Permalink
Work around RVO not being supported by Clang and MSVS
Browse files Browse the repository at this point in the history
  • Loading branch information
kordejong committed Jan 31, 2025
1 parent 37990d5 commit 1098c3d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions source/framework/io/include/lue/framework/io/from_lue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ namespace lue {
using Partition = typename Partitions::value_type;
using PartitionServer = Partition::Server;

auto&& [dataset_f, partitions_f, all_partitions_read_f] = hpx::split_future(hpx::dataflow(
auto [dataset_f, partitions_f, all_partitions_read_f] = hpx::split_future(hpx::dataflow(
hpx::launch::async,
hpx::unwrapping(
[policies, array_pathname, array_hyperslab_start, object_id](
Expand Down Expand Up @@ -191,7 +191,8 @@ namespace lue {
keep_dataset_open_until_all_partitions_read(
std::move(all_partitions_read_f), std::move(dataset_f));

return partitions_f;
// For some reason, RVO doesn't kick in on some compilers (Clang, MSVS)
return std::move(partitions_f);
}


Expand All @@ -207,7 +208,7 @@ namespace lue {
using Partition = typename Partitions::value_type;
using PartitionServer = Partition::Server;

auto&& [dataset_f, partitions_f, all_partitions_read_f] = hpx::split_future(hpx::dataflow(
auto [dataset_f, partitions_f, all_partitions_read_f] = hpx::split_future(hpx::dataflow(
hpx::launch::async,
hpx::unwrapping(
[policies, array_pathname, array_hyperslab_start, object_id, time_step_idx](
Expand Down Expand Up @@ -253,7 +254,8 @@ namespace lue {
keep_dataset_open_until_all_partitions_read(
std::move(all_partitions_read_f), std::move(dataset_f));

return partitions_f;
// For some reason, RVO doesn't kick in on some compilers (Clang, MSVS)
return std::move(partitions_f);
}


Expand Down

0 comments on commit 1098c3d

Please sign in to comment.