diff --git a/external/resinsight/LibCore/cvfColor3.h b/external/resinsight/LibCore/cvfColor3.h index c270af040..f766c580b 100644 --- a/external/resinsight/LibCore/cvfColor3.h +++ b/external/resinsight/LibCore/cvfColor3.h @@ -112,7 +112,7 @@ public: Color3f(); Color3f(float r, float g, float b); Color3f(const Color3f& other); - Color3f(ColorIdent colorIdent); + explicit Color3f(ColorIdent colorIdent); explicit Color3f(const Color3ub& other); Color3f& operator=(const Color3f& rhs); @@ -158,7 +158,7 @@ public: Color3ub(); Color3ub(ubyte r, ubyte g, ubyte b); Color3ub(const Color3ub& other); - Color3ub(ColorIdent colorIdent); + explicit Color3ub(ColorIdent colorIdent); explicit Color3ub(const Color3f& other); Color3ub& operator=(const Color3ub& rhs); diff --git a/external/resinsight/LibCore/cvfDebugTimer.h b/external/resinsight/LibCore/cvfDebugTimer.h index 2a6a64d9c..20ca6a1a0 100644 --- a/external/resinsight/LibCore/cvfDebugTimer.h +++ b/external/resinsight/LibCore/cvfDebugTimer.h @@ -60,7 +60,7 @@ public: }; public: - DebugTimer(const char* prefix, OperationMode operationMode = NORMAL); + explicit DebugTimer(const char* prefix, OperationMode operationMode = NORMAL); ~DebugTimer(); void restart(const char* msg = NULL); diff --git a/external/resinsight/LibCore/cvfFlags.h b/external/resinsight/LibCore/cvfFlags.h index 600f4c4b1..2418d3fc4 100644 --- a/external/resinsight/LibCore/cvfFlags.h +++ b/external/resinsight/LibCore/cvfFlags.h @@ -52,7 +52,7 @@ class Flags public: inline Flags(); inline Flags(const Flags& other); - inline Flags(FlagEnum flag); + explicit inline Flags(FlagEnum flag); inline Flags& operator=(const Flags& rhs); inline Flags& operator=(FlagEnum flag); diff --git a/external/resinsight/LibCore/cvfObject.h b/external/resinsight/LibCore/cvfObject.h index 88cc56e97..7314f4efb 100644 --- a/external/resinsight/LibCore/cvfObject.h +++ b/external/resinsight/LibCore/cvfObject.h @@ -99,7 +99,7 @@ class ref public: ref(T* object = NULL); ref(const ref& other); - template ref(const ref& other); + template explicit ref(const ref& other); ~ref(); ref& operator=(T* rhs); @@ -150,7 +150,7 @@ class cref public: cref(const T* object = NULL); cref(const cref& other); - template cref(const cref& other); + template explicit cref(const cref& other); ~cref(); cref& operator=(const T* rhs); diff --git a/external/resinsight/cafPdmCore/cafSignal.h b/external/resinsight/cafPdmCore/cafSignal.h index 8811437eb..0a3265403 100644 --- a/external/resinsight/cafPdmCore/cafSignal.h +++ b/external/resinsight/cafPdmCore/cafSignal.h @@ -108,7 +108,7 @@ public: using MemberCallbackAndActiveFlag = std::pair; public: - Signal( const SignalEmitter* emitter ) + explicit Signal( const SignalEmitter* emitter ) : m_emitter( emitter ) { m_emitter->addEmittedSignal( this ); diff --git a/opm/input/eclipse/Deck/DeckRecord.hpp b/opm/input/eclipse/Deck/DeckRecord.hpp index 017967d29..afbd88199 100644 --- a/opm/input/eclipse/Deck/DeckRecord.hpp +++ b/opm/input/eclipse/Deck/DeckRecord.hpp @@ -34,7 +34,7 @@ namespace Opm { typedef std::vector< DeckItem >::const_iterator const_iterator; DeckRecord() = default; - DeckRecord( std::vector< DeckItem >&& items, const bool check_for_duplicate_names = true ); + explicit DeckRecord( std::vector< DeckItem >&& items, const bool check_for_duplicate_names = true ); static DeckRecord serializationTestObject(); diff --git a/opm/input/eclipse/Deck/DeckTree.hpp b/opm/input/eclipse/Deck/DeckTree.hpp index 1abcd7d30..3b949b6bf 100644 --- a/opm/input/eclipse/Deck/DeckTree.hpp +++ b/opm/input/eclipse/Deck/DeckTree.hpp @@ -38,7 +38,7 @@ namespace Opm { class DeckTree { public: DeckTree() = default; - DeckTree(const std::string&); + explicit DeckTree(const std::string&); const std::string& parent(const std::string& fname) const; bool includes(const std::string& parent_file, const std::string& include_file) const; diff --git a/opm/input/eclipse/Deck/DeckView.hpp b/opm/input/eclipse/Deck/DeckView.hpp index 0e40caa23..486fc8da7 100644 --- a/opm/input/eclipse/Deck/DeckView.hpp +++ b/opm/input/eclipse/Deck/DeckView.hpp @@ -33,7 +33,7 @@ public: struct Iterator : public storage_type::iterator { - Iterator(storage_type::const_iterator inner_iter) : + explicit Iterator(storage_type::const_iterator inner_iter) : inner(inner_iter) {} diff --git a/opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp b/opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp index 249ef1ce0..7a989791c 100644 --- a/opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp +++ b/opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp @@ -124,7 +124,7 @@ namespace Opm { AquiferCT() = default; AquiferCT(const TableManager& tables, const Deck& deck); - AquiferCT(const std::vector& data); + explicit AquiferCT(const std::vector& data); void loadFromRestart(const RestartIO::RstAquifer& rst, const TableManager& tables); diff --git a/opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp b/opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp index 2cb59f96d..aadb88d0f 100644 --- a/opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp +++ b/opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp @@ -75,7 +75,7 @@ namespace Opm { /// EclipseGrid ignores ACTNUM in Deck, and therefore needs ACTNUM /// explicitly. If a null pointer is passed, every cell is active. - EclipseGrid(const Deck& deck, const int * actnum = nullptr); + explicit EclipseGrid(const Deck& deck, const int * actnum = nullptr); static bool hasGDFILE(const Deck& deck); static bool hasCylindricalKeywords(const Deck& deck); diff --git a/opm/input/eclipse/EclipseState/Tables/PlymaxTable.hpp b/opm/input/eclipse/EclipseState/Tables/PlymaxTable.hpp index f2d09480f..0a86fc9ea 100644 --- a/opm/input/eclipse/EclipseState/Tables/PlymaxTable.hpp +++ b/opm/input/eclipse/EclipseState/Tables/PlymaxTable.hpp @@ -28,7 +28,7 @@ namespace Opm { class PlymaxTable : public SimpleTable { public: - PlymaxTable( const DeckRecord& record ); + explicit PlymaxTable(const DeckRecord& record); const TableColumn& getPolymerConcentrationColumn() const; const TableColumn& getMaxPolymerConcentrationColumn() const; diff --git a/opm/input/eclipse/EclipseState/Tables/PlyrockTable.hpp b/opm/input/eclipse/EclipseState/Tables/PlyrockTable.hpp index 86059987e..122a1d5bc 100644 --- a/opm/input/eclipse/EclipseState/Tables/PlyrockTable.hpp +++ b/opm/input/eclipse/EclipseState/Tables/PlyrockTable.hpp @@ -23,13 +23,13 @@ namespace Opm { - class DeckReckord; + class DeckRecord; class PlyrockTable : public SimpleTable { public: // This is not really a table; every column has only one element. - PlyrockTable( const DeckRecord& record ); + explicit PlyrockTable(const DeckRecord& record); // since this keyword is not necessarily monotonic, it cannot be evaluated! //using SimpleTable::evaluate; diff --git a/opm/input/eclipse/Generator/KeywordGenerator.hpp b/opm/input/eclipse/Generator/KeywordGenerator.hpp index aa7af85a2..d22f7f787 100644 --- a/opm/input/eclipse/Generator/KeywordGenerator.hpp +++ b/opm/input/eclipse/Generator/KeywordGenerator.hpp @@ -30,7 +30,7 @@ namespace Opm { class KeywordGenerator { public: - KeywordGenerator(bool verbose); + explicit KeywordGenerator(bool verbose); static void ensurePath( const std::string& file_name); static std::string endTest(); diff --git a/opm/input/eclipse/Schedule/Action/State.hpp b/opm/input/eclipse/Schedule/Action/State.hpp index 68040f3ec..34bfaa4c5 100644 --- a/opm/input/eclipse/Schedule/Action/State.hpp +++ b/opm/input/eclipse/Schedule/Action/State.hpp @@ -42,7 +42,7 @@ class State { struct RunState { RunState() = default; - RunState(std::time_t sim_time) + explicit RunState(std::time_t sim_time) : run_count(1) , last_run(sim_time) {} diff --git a/opm/input/eclipse/Schedule/CompletedCells.hpp b/opm/input/eclipse/Schedule/CompletedCells.hpp index 907d4a802..38d822d99 100644 --- a/opm/input/eclipse/Schedule/CompletedCells.hpp +++ b/opm/input/eclipse/Schedule/CompletedCells.hpp @@ -121,7 +121,7 @@ public: }; CompletedCells() = default; - CompletedCells(const GridDims& dims); + explicit CompletedCells(const GridDims& dims); CompletedCells(std::size_t nx, std::size_t ny, std::size_t nz); const Cell& get(std::size_t i, std::size_t j, std::size_t k) const; std::pair try_get(std::size_t i, std::size_t j, std::size_t k); diff --git a/opm/input/eclipse/Schedule/GasLiftOpt.hpp b/opm/input/eclipse/Schedule/GasLiftOpt.hpp index 48920cb6d..4ef1c711f 100644 --- a/opm/input/eclipse/Schedule/GasLiftOpt.hpp +++ b/opm/input/eclipse/Schedule/GasLiftOpt.hpp @@ -31,7 +31,7 @@ class GasLiftGroup { public: GasLiftGroup() = default; - GasLiftGroup(const std::string& name) : + explicit GasLiftGroup(const std::string& name) : m_name(name) {} diff --git a/opm/input/eclipse/Schedule/Group/GuideRate.hpp b/opm/input/eclipse/Schedule/Group/GuideRate.hpp index 780fb4309..6a5d5fc44 100644 --- a/opm/input/eclipse/Schedule/Group/GuideRate.hpp +++ b/opm/input/eclipse/Schedule/Group/GuideRate.hpp @@ -111,7 +111,7 @@ public: GuideRateModel::Target target { GuideRateModel::Target::NONE }; }; - GuideRate(const Schedule& schedule); + explicit GuideRate(const Schedule& schedule); void setSerializationTestData(); diff --git a/opm/input/eclipse/Schedule/MSW/AICD.hpp b/opm/input/eclipse/Schedule/MSW/AICD.hpp index 4e93f3d6a..d2dbd90dc 100644 --- a/opm/input/eclipse/Schedule/MSW/AICD.hpp +++ b/opm/input/eclipse/Schedule/MSW/AICD.hpp @@ -35,7 +35,7 @@ namespace Opm { class AutoICD : public SICD { public: AutoICD() = default; - AutoICD(const DeckRecord& record); + explicit AutoICD(const DeckRecord& record); static AutoICD serializationTestObject(); diff --git a/opm/input/eclipse/Schedule/MSW/Segment.hpp b/opm/input/eclipse/Schedule/MSW/Segment.hpp index 86478eed1..0177582ad 100644 --- a/opm/input/eclipse/Schedule/MSW/Segment.hpp +++ b/opm/input/eclipse/Schedule/MSW/Segment.hpp @@ -90,7 +90,7 @@ namespace Opm { const double x_in, const double y_in); - Segment(const RestartIO::RstSegment& rst_segment); + explicit Segment(const RestartIO::RstSegment& rst_segment); static Segment serializationTestObject(); diff --git a/opm/input/eclipse/Schedule/Network/Node.hpp b/opm/input/eclipse/Schedule/Network/Node.hpp index fb7a7f5ff..0368243a4 100644 --- a/opm/input/eclipse/Schedule/Network/Node.hpp +++ b/opm/input/eclipse/Schedule/Network/Node.hpp @@ -30,7 +30,7 @@ namespace Network { class Node { public: Node() = default; - Node(const std::string& name); + explicit Node(const std::string& name); const std::string& name() const; const std::optional& terminal_pressure() const; diff --git a/opm/input/eclipse/Schedule/UDQ/UDQState.hpp b/opm/input/eclipse/Schedule/UDQ/UDQState.hpp index 736f088c7..b681c3b73 100644 --- a/opm/input/eclipse/Schedule/UDQ/UDQState.hpp +++ b/opm/input/eclipse/Schedule/UDQ/UDQState.hpp @@ -38,7 +38,7 @@ class UDQState { public: UDQState() = default; - UDQState(double undefined); + explicit UDQState(double undefined); bool has(const std::string& key) const; void load_rst(const RestartIO::RstState& rst_state); diff --git a/opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp b/opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp index 92cd47c02..bee84043b 100644 --- a/opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp +++ b/opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp @@ -28,7 +28,7 @@ namespace Opm { struct WellInjectionControls { public: - WellInjectionControls(int controls_arg) : + explicit WellInjectionControls(int controls_arg) : controls(controls_arg) {} diff --git a/opm/input/eclipse/Schedule/Well/WellProductionControls.hpp b/opm/input/eclipse/Schedule/Well/WellProductionControls.hpp index b94e7d3a4..e277a289a 100644 --- a/opm/input/eclipse/Schedule/Well/WellProductionControls.hpp +++ b/opm/input/eclipse/Schedule/Well/WellProductionControls.hpp @@ -28,7 +28,7 @@ namespace Opm { struct WellProductionControls { public: - WellProductionControls(int controls_arg) : + explicit WellProductionControls(int controls_arg) : controls(controls_arg) { } diff --git a/opm/input/eclipse/Units/Dimension.hpp b/opm/input/eclipse/Units/Dimension.hpp index 424a0f8b4..1244cf74a 100644 --- a/opm/input/eclipse/Units/Dimension.hpp +++ b/opm/input/eclipse/Units/Dimension.hpp @@ -27,8 +27,8 @@ namespace Opm { class Dimension { public: Dimension(); - Dimension(double SIfactor, - double SIoffset = 0.0); + explicit Dimension(double SIfactor, + double SIoffset = 0.0); static Dimension serializationTestObject(); diff --git a/opm/io/eclipse/ERsm.hpp b/opm/io/eclipse/ERsm.hpp index d44c00b79..1318e6888 100644 --- a/opm/io/eclipse/ERsm.hpp +++ b/opm/io/eclipse/ERsm.hpp @@ -56,7 +56,7 @@ struct Vector{ public: - ERsm(const std::string& fname); + explicit ERsm(const std::string& fname); const std::vector& dates() const; const std::vector& days() const; diff --git a/opm/io/eclipse/rst/action.hpp b/opm/io/eclipse/rst/action.hpp index f18e61ba0..452aa9d50 100644 --- a/opm/io/eclipse/rst/action.hpp +++ b/opm/io/eclipse/rst/action.hpp @@ -39,8 +39,8 @@ struct RstAction { Quantity() = default; Quantity(const std::string * zacn, double sacn_value); - Quantity(const std::string& quantity); - Quantity(double value); + explicit Quantity(const std::string& quantity); + explicit Quantity(double value); }; diff --git a/src/opm/input/eclipse/EclipseState/Aquifer/AquiferCT.cpp b/src/opm/input/eclipse/EclipseState/Aquifer/AquiferCT.cpp index 97e22b038..7fc34073a 100644 --- a/src/opm/input/eclipse/EclipseState/Aquifer/AquiferCT.cpp +++ b/src/opm/input/eclipse/EclipseState/Aquifer/AquiferCT.cpp @@ -264,7 +264,7 @@ void AquiferCT::loadFromRestart(const RestartIO::RstAquifer& rst, AquiferCT AquiferCT::serializationTestObject() { - return { { AQUCT_data::serializationTestObject() } }; + return AquiferCT{ { AQUCT_data::serializationTestObject() } }; } std::size_t AquiferCT::size() const { diff --git a/src/opm/input/eclipse/Parser/ParserRecord.cpp b/src/opm/input/eclipse/Parser/ParserRecord.cpp index a35d7d5ea..f1a4cf31d 100644 --- a/src/opm/input/eclipse/Parser/ParserRecord.cpp +++ b/src/opm/input/eclipse/Parser/ParserRecord.cpp @@ -136,7 +136,7 @@ namespace { parseContext.handleError(ParseContext::PARSE_EXTRA_DATA , msg_format, location, errors); } - return { std::move( items ), false }; + return DeckRecord{ std::move( items ), false }; } bool ParserRecord::equal(const ParserRecord& other) const {