Commit af757b31 authored by Miro Knejp's avatar Miro Knejp

Don't generate polymorphic lambdas for C++11 compatibility

parent 972bf385
...@@ -33,7 +33,7 @@ auto SortItems::toCpp(ObjcType objc) -> CppType ...@@ -33,7 +33,7 @@ auto SortItems::toCpp(ObjcType objc) -> CppType
auto SortItems::fromCpp(const CppType& cpp) -> ObjcType auto SortItems::fromCpp(const CppType& cpp) -> ObjcType
{ {
return !cpp ? nil : ::djinni::DbxCppWrapperCache<::textsort::SortItems>::getInstance()->get(cpp, [] (const auto& p) return !cpp ? nil : ::djinni::DbxCppWrapperCache<::textsort::SortItems>::getInstance()->get(cpp, [] (const CppType& p)
{ {
return [[TXSSortItems alloc] initWithCpp:p]; return [[TXSSortItems alloc] initWithCpp:p];
}); });
......
...@@ -157,7 +157,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -157,7 +157,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
w.wl w.wl
w.wl(s"auto $helperClass::fromCpp(const CppType& cpp) -> ObjcType") w.wl(s"auto $helperClass::fromCpp(const CppType& cpp) -> ObjcType")
w.braced { w.braced {
w.wl(s"return !cpp ? nil : ::djinni::DbxCppWrapperCache<$cppSelf>::getInstance()->get(cpp, [] (const auto& p)").bracedEnd(");") { w.wl(s"return !cpp ? nil : ::djinni::DbxCppWrapperCache<$cppSelf>::getInstance()->get(cpp, [] (const CppType& p)").bracedEnd(");") {
w.wl(s"return [[$self alloc] initWithCpp:p];") w.wl(s"return [[$self alloc] initWithCpp:p];")
} }
} }
......
...@@ -31,7 +31,7 @@ auto CppException::toCpp(ObjcType objc) -> CppType ...@@ -31,7 +31,7 @@ auto CppException::toCpp(ObjcType objc) -> CppType
auto CppException::fromCpp(const CppType& cpp) -> ObjcType auto CppException::fromCpp(const CppType& cpp) -> ObjcType
{ {
return !cpp ? nil : ::djinni::DbxCppWrapperCache<::CppException>::getInstance()->get(cpp, [] (const auto& p) return !cpp ? nil : ::djinni::DbxCppWrapperCache<::CppException>::getInstance()->get(cpp, [] (const CppType& p)
{ {
return [[DBCppException alloc] initWithCpp:p]; return [[DBCppException alloc] initWithCpp:p];
}); });
......
...@@ -37,7 +37,7 @@ auto TestHelpers::toCpp(ObjcType objc) -> CppType ...@@ -37,7 +37,7 @@ auto TestHelpers::toCpp(ObjcType objc) -> CppType
auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
{ {
return !cpp ? nil : ::djinni::DbxCppWrapperCache<::TestHelpers>::getInstance()->get(cpp, [] (const auto& p) return !cpp ? nil : ::djinni::DbxCppWrapperCache<::TestHelpers>::getInstance()->get(cpp, [] (const CppType& p)
{ {
return [[DBTestHelpers alloc] initWithCpp:p]; return [[DBTestHelpers alloc] initWithCpp:p];
}); });
......
...@@ -29,7 +29,7 @@ auto Token::toCpp(ObjcType objc) -> CppType ...@@ -29,7 +29,7 @@ auto Token::toCpp(ObjcType objc) -> CppType
auto Token::fromCpp(const CppType& cpp) -> ObjcType auto Token::fromCpp(const CppType& cpp) -> ObjcType
{ {
return !cpp ? nil : ::djinni::DbxCppWrapperCache<::Token>::getInstance()->get(cpp, [] (const auto& p) return !cpp ? nil : ::djinni::DbxCppWrapperCache<::Token>::getInstance()->get(cpp, [] (const CppType& p)
{ {
return [[DBToken alloc] initWithCpp:p]; return [[DBToken alloc] initWithCpp:p];
}); });
......
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