Skip to content

Commit 6e2ace5

Browse files
Fix false positives for std::vector::operator=() (#1824)
see overload 3, the use is actually correct https://en.cppreference.com/w/cpp/container/vector/operator=.html
1 parent c734fb5 commit 6e2ace5

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

examples/14_toml_template.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void write()
7272
*/
7373
E["z"].resetDataset({});
7474

75-
ds.extent = {10};
75+
ds.extent = std::vector<openPMD::Extent::value_type>{10};
7676

7777
auto electrons = iteration.particles["e"];
7878
electrons["position"]["x"].resetDataset(ds);

include/openPMD/Iteration.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class Iteration : public Attributable
344344
*/
345345
struct BeginStepStatus
346346
{
347-
using AvailableIterations_t = std::vector<uint64_t>;
347+
using AvailableIterations_t = std::vector<IterationIndex_t>;
348348

349349
AdvanceStatus stepStatus{};
350350
/*

src/IO/HDF5/HDF5IOHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ void HDF5IOHandlerImpl::openDataset(
15821582
{
15831583
// Is a scalar. Since the openPMD-api frontend supports no scalar
15841584
// datasets, return the extent as {1}
1585-
*parameters.extent = {1};
1585+
*parameters.extent = std::vector<Extent::value_type>{1};
15861586
}
15871587
else
15881588
{

src/Iteration.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,8 @@ auto Iteration::beginStep(
863863
else if (thisObject.has_value())
864864
{
865865
IterationIndex_t idx = series.indexOf(*thisObject)->first;
866-
res.iterationsInOpenedStep = {idx};
866+
res.iterationsInOpenedStep =
867+
std::vector<Iteration::IterationIndex_t>{idx};
867868
}
868869
else
869870
{

src/snapshots/ContainerImpls.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ auto StatefulSnapshotsContainer::operator[](key_type const &key)
289289
{
290290
case AdvanceStatus::OK:
291291
++during.step_count;
292-
during.available_iterations_in_step = {key};
292+
during.available_iterations_in_step =
293+
std::vector<Iteration::IterationIndex_t>{key};
293294
break;
294295
case AdvanceStatus::RANDOMACCESS:
295296
during.available_iterations_in_step.emplace_back(key);

0 commit comments

Comments
 (0)