Skip to content

Commit 2b93b55

Browse files
authored
Merge pull request #203 from dtolnay/unique
Switch demo code to using std::make_unique
2 parents 4ab952d + c13ad23 commit 2b93b55

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

demo-cxx/BUCK

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cxx_library(
22
name = "demo-cxx",
33
srcs = ["demo.cc"],
4+
compiler_flags = ["-std=c++14"],
45
visibility = ["PUBLIC"],
56
deps = [
67
":include",

demo-cxx/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cc_library(
22
name = "demo-cxx",
33
srcs = ["demo.cc"],
4+
copts = ["-std=c++14"],
45
visibility = ["//visibility:public"],
56
deps = [
67
":include",

demo-cxx/demo.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ThingC::ThingC(std::string appname) : appname(std::move(appname)) {}
1010
ThingC::~ThingC() { std::cout << "done with ThingC" << std::endl; }
1111

1212
std::unique_ptr<ThingC> make_demo(rust::Str appname) {
13-
return std::unique_ptr<ThingC>(new ThingC(std::string(appname)));
13+
return std::make_unique<ThingC>(std::string(appname));
1414
}
1515

1616
const std::string &get_name(const ThingC &thing) { return thing.appname; }

demo-rs/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
fn main() {
22
cxx_build::bridge("src/main.rs")
33
.file("../demo-cxx/demo.cc")
4-
.flag_if_supported("-std=c++11")
4+
.flag_if_supported("-std=c++14")
55
.compile("cxxbridge-demo");
66

77
println!("cargo:rerun-if-changed=src/main.rs");

0 commit comments

Comments
 (0)