Use std::make_unique instead of our polyfill or naked new

The use we previously used the polyfill or naked new is that we
supported C++11, which did not yet have `std::make_unique`. However,
with the move to C++14 as the minimum, `std::make_unique` can be
expected to be always available.
This commit is contained in:
Martin Hořeňovský 2020-02-01 21:43:00 +01:00
parent a7b3e087a0
commit ea6db67063
No known key found for this signature in database
GPG key ID: DE48307B8B0D381A
8 changed files with 22 additions and 30 deletions

View file

@ -38,9 +38,7 @@ std::string const& LineGenerator::get() const {
// is a value-wrapper around std::unique_ptr<IGenerator<std::string>>.
Catch::Generators::GeneratorWrapper<std::string> lines(std::string /* ignored for example */) {
return Catch::Generators::GeneratorWrapper<std::string>(
std::unique_ptr<Catch::Generators::IGenerator<std::string>>(
new LineGenerator()
)
std::make_unique<LineGenerator>()
);
}