Commit 82ca9318 authored by Miro Knejp's avatar Miro Knejp

Re-enable copy/move special member generation in +c records

parent 90ca78a1
...@@ -219,7 +219,15 @@ class CppGenerator(spec: Spec) extends Generator(spec) { ...@@ -219,7 +219,15 @@ class CppGenerator(spec: Spec) extends Generator(spec) {
if (r.ext.cpp) { if (r.ext.cpp) {
w.wl w.wl
w.wl(s"virtual ~$actualSelf() {}") w.wl(s"virtual ~$actualSelf() = default;")
w.wl
// Defining the dtor disables implicit copy/move operation generation, so re-enable them
// Make them protected to avoid slicing
w.wlOutdent("protected:")
w.wl(s"$actualSelf(const $actualSelf&) = default;")
w.wl(s"$actualSelf($actualSelf&&) = default;")
w.wl(s"$actualSelf& operator=(const $actualSelf&) = default;")
w.wl(s"$actualSelf& operator=($actualSelf&&) = default;")
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment