Skip to content

Commit 10f4981

Browse files
committed
Emplace scalar tuple only when needed
1 parent 7491a9b commit 10f4981

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/openPMD/backend/BaseRecord.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "openPMD/backend/Container.hpp"
2929

3030
#include <array>
31+
#include <optional>
3132
#include <stdexcept>
3233
#include <string>
3334
#include <type_traits> // std::remove_reference_t
@@ -114,9 +115,7 @@ namespace internal
114115
{}
115116
ScalarIterator(T_BaseRecord *baseRecord, Left iterator)
116117
: m_baseRecordData(&baseRecord->get())
117-
, m_scalarTuple(
118-
std::make_pair(
119-
RecordComponent::SCALAR, T_RecordComponent(*baseRecord)))
118+
, m_scalarTuple(std::nullopt)
120119
, m_iterator(std::move(iterator))
121120
{}
122121

0 commit comments

Comments
 (0)