Commit 578f7544 authored by Kenton Varda's avatar Kenton Varda

Don't delete default dynamic builder constructors, because this makes things…

Don't delete default dynamic builder constructors, because this makes things difficult for the Python wrappers.
parent 24d5567c
...@@ -444,9 +444,10 @@ TEST(DynamicApi, BuilderAssign) { ...@@ -444,9 +444,10 @@ TEST(DynamicApi, BuilderAssign) {
auto root = builder.initRoot<DynamicStruct>(Schema::from<TestAllTypes>()); auto root = builder.initRoot<DynamicStruct>(Schema::from<TestAllTypes>());
// Declare upfront, assign later. // Declare upfront, assign later.
// Note that the Python implementation requires defaulted constructors. Do not delete them!
DynamicValue::Builder value; DynamicValue::Builder value;
DynamicStruct::Builder structValue = nullptr; DynamicStruct::Builder structValue;
DynamicList::Builder listValue = nullptr; DynamicList::Builder listValue;
value = root.get("structField"); value = root.get("structField");
structValue = value.as<DynamicStruct>(); structValue = value.as<DynamicStruct>();
......
...@@ -187,7 +187,7 @@ class DynamicObject::Builder: public kj::DisallowConstCopy { ...@@ -187,7 +187,7 @@ class DynamicObject::Builder: public kj::DisallowConstCopy {
public: public:
typedef DynamicObject Builds; typedef DynamicObject Builds;
Builder() = delete; Builder() = default;
inline Builder(decltype(nullptr)) {} inline Builder(decltype(nullptr)) {}
Builder(Builder&) = default; Builder(Builder&) = default;
Builder(Builder&&) = default; Builder(Builder&&) = default;
...@@ -277,7 +277,7 @@ class DynamicStruct::Builder { ...@@ -277,7 +277,7 @@ class DynamicStruct::Builder {
public: public:
typedef DynamicStruct Builds; typedef DynamicStruct Builds;
Builder() = delete; Builder() = default;
inline Builder(decltype(nullptr)) {} inline Builder(decltype(nullptr)) {}
template <typename T, typename = kj::EnableIf<kind<FromBuilder<T>>() == Kind::STRUCT>> template <typename T, typename = kj::EnableIf<kind<FromBuilder<T>>() == Kind::STRUCT>>
...@@ -430,7 +430,7 @@ class DynamicList::Builder { ...@@ -430,7 +430,7 @@ class DynamicList::Builder {
public: public:
typedef DynamicList Builds; typedef DynamicList Builds;
Builder() = delete; Builder() = default;
inline Builder(decltype(nullptr)) {} inline Builder(decltype(nullptr)) {}
template <typename T, typename = kj::EnableIf<kind<FromBuilder<T>>() == Kind::LIST>> template <typename T, typename = kj::EnableIf<kind<FromBuilder<T>>() == Kind::LIST>>
......
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