Skip to content

Commit cdde643

Browse files
committed
Mark single argument ctors of IoData explicit
- Bind && to local object in ctor
1 parent 0dad8aa commit cdde643

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

palace/utils/iodata.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ std::stringstream PreprocessFile(const char *filename)
150150

151151
using json = nlohmann::json;
152152

153-
IoData::IoData(nlohmann::json &&config) : units(1.0, 1.0), init(false)
153+
IoData::IoData(nlohmann::json &&config_) : units(1.0, 1.0), init(false)
154154
{
155+
auto config = std::move(config_);
155156
// Set up configuration option data structures.
156157
problem.SetUp(config);
157158
model.SetUp(config);

palace/utils/iodata.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ class IoData
4343
void CheckConfiguration();
4444

4545
public:
46-
IoData(const Units &units) : units(units), init(false) {}
46+
explicit IoData(const Units &units) : units(units), init(false) {}
4747

4848
// Take parsed json and override options defaults.
49-
IoData(nlohmann::json &&config);
49+
explicit IoData(nlohmann::json &&config);
5050

5151
// Parse command line arguments and override options defaults.
5252
IoData(const char *filename, bool print);

0 commit comments

Comments
 (0)