Skip to content

Commit 34ac869

Browse files
committed
Fixing broken constructor
1 parent 99916ff commit 34ac869

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ namespace hpx {
535535
}
536536

537537
template <typename T, typename Data /*= std::vector<T> */>
538+
HPX_PARTITIONED_VECTOR_SPECIALIZATION_EXPORT
538539
partitioned_vector<T, Data>::partitioned_vector(
539540
typename Data::const_iterator begin, typename Data::const_iterator end)
540541
: size_(std::distance(begin, end))
@@ -576,11 +577,10 @@ namespace hpx {
576577
template <typename T, typename Data /*= std::vector<T> */>
577578
template <typename DistPolicy>
578579
HPX_PARTITIONED_VECTOR_SPECIALIZATION_EXPORT
579-
partitioned_vector<T, Data>::partitioned_vector(DistPolicy const& policy,
580+
partitioned_vector<T, Data>::partitioned_vector(DistPolicy const&,
580581
std::enable_if_t<traits::is_distribution_policy_v<DistPolicy>>*)
581582
: size_(0)
582583
{
583-
reserve(policy);
584584
}
585585

586586
template <typename T, typename Data /*= std::vector<T> */>

components/containers/partitioned_vector/tests/regressions/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
# Copyright (c) 2007-2017 Hartmut Kaiser
1+
# Copyright (c) 2007-2025 Hartmut Kaiser
22
#
33
# SPDX-License-Identifier: BSL-1.0
44
# Distributed under the Boost Software License, Version 1.0. (See accompanying
55
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

7-
set(tests partitioned_vector_2201)
7+
set(tests partitioned_vector_2201 partitioned_vector_constructor_6650)
88

99
set(partitioned_vector_2201_FLAGS COMPONENT_DEPENDENCIES partitioned_vector)
10+
set(partitioned_vector_constructor_6650_FLAGS COMPONENT_DEPENDENCIES
11+
partitioned_vector
12+
)
1013

1114
foreach(test ${tests})
1215
set(sources ${test}.cpp)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) 2025 Hartmut Kaiser
2+
//
3+
// SPDX-License-Identifier: BSL-1.0
4+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
5+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6+
7+
#include <hpx/config.hpp>
8+
9+
#if !defined(HPX_COMPUTE_DEVICE_CODE)
10+
#include <hpx/hpx_main.hpp>
11+
#include <hpx/include/partitioned_vector.hpp>
12+
#include <hpx/modules/runtime_distributed.hpp>
13+
14+
///////////////////////////////////////////////////////////////////////////////
15+
int main()
16+
{
17+
// create as many partitions as we have localities
18+
[[maybe_unused]] hpx::partitioned_vector<int> data(
19+
hpx::container_layout(hpx::find_all_localities()));
20+
21+
return 0;
22+
}
23+
24+
#else
25+
26+
int main()
27+
{
28+
return 0;
29+
}
30+
31+
#endif

0 commit comments

Comments
 (0)