absl's make unique

This commit is contained in:
Paul Fd 2020-03-10 17:55:22 +01:00
parent 624f014dec
commit 2d74e0c776
2 changed files with 5 additions and 4 deletions

View file

@ -37,7 +37,7 @@
#include "Lofi.h" #include "Lofi.h"
#include "Opcode.h" #include "Opcode.h"
#include <memory> #include "absl/memory/memory.h"
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <cmath> #include <cmath>
@ -79,7 +79,7 @@ namespace fx {
std::unique_ptr<Effect> Lofi::makeInstance(absl::Span<const Opcode> members) std::unique_ptr<Effect> Lofi::makeInstance(absl::Span<const Opcode> members)
{ {
auto fx = std::make_unique<Lofi>(); auto fx = absl::make_unique<Lofi>();
for (const Opcode& opcode : members) { for (const Opcode& opcode : members) {
switch (opcode.lettersOnlyHash) { switch (opcode.lettersOnlyHash) {
@ -92,7 +92,7 @@ namespace fx {
} }
} }
return fx; return std::move(fx);
} }
/// ///

View file

@ -6,10 +6,11 @@
#include "Synth.h" #include "Synth.h"
#include "sfizz.hpp" #include "sfizz.hpp"
#include "absl/memory/memory.h"
sfz::Sfizz::Sfizz() sfz::Sfizz::Sfizz()
{ {
synth = std::make_unique<sfz::Synth>(); synth = absl::make_unique<sfz::Synth>();
} }
sfz::Sfizz::~Sfizz() sfz::Sfizz::~Sfizz()