Switch demo code to using std::make_unique
diff --git a/demo-cxx/BUCK b/demo-cxx/BUCK
index 595a18b..f60200b 100644
--- a/demo-cxx/BUCK
+++ b/demo-cxx/BUCK
@@ -1,6 +1,7 @@
cxx_library(
name = "demo-cxx",
srcs = ["demo.cc"],
+ compiler_flags = ["-std=c++14"],
visibility = ["PUBLIC"],
deps = [
":include",
diff --git a/demo-cxx/BUILD b/demo-cxx/BUILD
index da97cfa..7b1860a 100644
--- a/demo-cxx/BUILD
+++ b/demo-cxx/BUILD
@@ -1,6 +1,7 @@
cc_library(
name = "demo-cxx",
srcs = ["demo.cc"],
+ copts = ["-std=c++14"],
visibility = ["//visibility:public"],
deps = [
":include",
diff --git a/demo-cxx/demo.cc b/demo-cxx/demo.cc
index cd447ea..21bdad4 100644
--- a/demo-cxx/demo.cc
+++ b/demo-cxx/demo.cc
@@ -10,7 +10,7 @@
ThingC::~ThingC() { std::cout << "done with ThingC" << std::endl; }
std::unique_ptr<ThingC> make_demo(rust::Str appname) {
- return std::unique_ptr<ThingC>(new ThingC(std::string(appname)));
+ return std::make_unique<ThingC>(std::string(appname));
}
const std::string &get_name(const ThingC &thing) { return thing.appname; }
diff --git a/demo-rs/build.rs b/demo-rs/build.rs
index e4792c2..f32b8ef 100644
--- a/demo-rs/build.rs
+++ b/demo-rs/build.rs
@@ -1,7 +1,7 @@
fn main() {
cxx_build::bridge("src/main.rs")
.file("../demo-cxx/demo.cc")
- .flag_if_supported("-std=c++11")
+ .flag_if_supported("-std=c++14")
.compile("cxxbridge-demo");
println!("cargo:rerun-if-changed=src/main.rs");