Commit eceef098 authored by Andrew Twyman's avatar Andrew Twyman

Merge pull request #123 from NachoSoto/copy-objc-collections

Returning immutable Objective-C collections when converting from C++
parents 946e0ac5 d445a097
...@@ -221,7 +221,7 @@ public: ...@@ -221,7 +221,7 @@ public:
for(const auto& value : v) { for(const auto& value : v) {
[array addObject:T::Boxed::fromCpp(value)]; [array addObject:T::Boxed::fromCpp(value)];
} }
return array; return [array copy];
} }
}; };
...@@ -251,7 +251,7 @@ public: ...@@ -251,7 +251,7 @@ public:
for(const auto& value : s) { for(const auto& value : s) {
[set addObject:T::Boxed::fromCpp(value)]; [set addObject:T::Boxed::fromCpp(value)];
} }
return set; return [set copy];
} }
}; };
...@@ -284,7 +284,7 @@ public: ...@@ -284,7 +284,7 @@ public:
for(const auto& kvp : m) { for(const auto& kvp : m) {
[map setObject:Value::Boxed::fromCpp(kvp.second) forKey:Key::Boxed::fromCpp(kvp.first)]; [map setObject:Value::Boxed::fromCpp(kvp.second) forKey:Key::Boxed::fromCpp(kvp.first)];
} }
return map; return [map copy];
} }
}; };
......
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