Include <new> when placement new is used
diff --git a/gen/src/write.rs b/gen/src/write.rs
index 2cf9faf..46b6151 100644
--- a/gen/src/write.rs
+++ b/gen/src/write.rs
@@ -149,11 +149,13 @@
for ty in types {
match ty {
Type::RustBox(_) => {
+ out.include.new = true;
out.include.type_traits = true;
needs_rust_box = true;
}
Type::RustVec(_) => {
out.include.array = true;
+ out.include.new = true;
out.include.type_traits = true;
needs_rust_vec = true;
}
@@ -463,6 +465,7 @@
write!(out, " ");
}
if indirect_return {
+ out.include.new = true;
write!(out, "new (return$) ");
write_indirect_return_type(out, efn.ret.as_ref().unwrap());
write!(out, "(");
@@ -1149,6 +1152,7 @@
// Shared by UniquePtr<T> and UniquePtr<CxxVector<T>>.
fn write_unique_ptr_common(out: &mut OutFile, ty: &Type, types: &Types) {
+ out.include.new = true;
out.include.utility = true;
let inner = to_typename(&out.namespace, ty);
let instance = to_mangled(&out.namespace, ty);