Index: mojo/public/cpp/bindings/array.h |
diff --git a/mojo/public/cpp/bindings/array.h b/mojo/public/cpp/bindings/array.h |
index 0ef62619439c7e03642eb1805f3de9d52c212c4b..53c8c1842dda113d84efc592e95c05e9e19900be 100644 |
--- a/mojo/public/cpp/bindings/array.h |
+++ b/mojo/public/cpp/bindings/array.h |
@@ -105,6 +105,16 @@ class Array { |
vec_.swap(*other); |
} |
+ // Please note that calling this method will fail compilation if the element |
+ // type cannot be cloned (which usually means that it is a Mojo handle type or |
+ // a type contains Mojo handles). |
+ Array Clone() const { |
+ Array result; |
+ result.is_null_ = is_null_; |
+ Traits::Clone(vec_, &result.vec_); |
+ return result.Pass(); |
+ } |
+ |
private: |
typedef std::vector<StorageType> Array::*Testable; |