use std::make_unique where applicable

This commit is contained in:
Arne Morten Kvarving
2020-09-02 15:35:39 +02:00
parent 4b45623333
commit 7305f84351
9 changed files with 14 additions and 14 deletions

View File

@@ -230,7 +230,7 @@ public:
{
typedef GlobalIndexDataHandle<GridView> DataHandle ;
assert(&grid_ == &gridView.grid());
return std::unique_ptr<DataHandle>(new DataHandle(gridView, cartesianIndex_));
return std::make_unique<DataHandle>(gridView, cartesianIndex_);
}
protected:

View File

@@ -239,7 +239,7 @@ public:
tmp.emplace_back(Opm::ParseContext::SUMMARY_UNKNOWN_GROUP, Opm::InputError::WARN);
tmp.emplace_back(Opm::ParseContext::PARSE_EXTRA_RECORDS, Opm::InputError::WARN);
std::unique_ptr<Opm::ParseContext> parseContext(new Opm::ParseContext(tmp));
auto parseContext = std::make_unique<Opm::ParseContext>(tmp);
const std::string ignoredKeywords = EWOMS_GET_PARAM(TypeTag, std::string, IgnoreKeywords);
if (ignoredKeywords.size() > 0) {

View File

@@ -69,7 +69,7 @@ int main(int argc, char **argv)
std::unique_ptr<Opm::ParseContext> parseContext
= Opm::ebosBlackOilCreateParseContext(argc, argv);
std::unique_ptr<Opm::ErrorGuard> errorGuard(new Opm::ErrorGuard);
auto errorGuard = std::make_unique<Opm::ErrorGuard>();
// deal with parallel runs
int myRank = Dune::MPIHelper::instance(argc, argv).rank();
@@ -78,7 +78,7 @@ int main(int argc, char **argv)
// parse the deck file
if (myRank == 0)
std::cout << "Parsing deck file \"" << deckFileName << "\"" << std::endl;
std::unique_ptr<Opm::Deck> deck(new Opm::Deck(parser.parseFile(deckFileName, *parseContext, *errorGuard)));
auto deck = std::make_unique<Opm::Deck>(parser.parseFile(deckFileName, *parseContext, *errorGuard));
// TODO: check which variant ought to be used
bool waterActive = deck->hasKeyword("WATER");