Hi --
I would like to be able to pass a Swift Array to C++ code. I know it should be possible, but having trouble figuring out the right way to do it. Here is an example class showing what I want to do.
C++ code:
class Foo {
public:
Foo(const std::vector<uint8_t> & values) : _values(values) {}
protected:
std::vector<uint_8> _values;
};
Swift code:
let values: [UInt8] = [ 1, 2, 3, 4, 5, 6 ]
var foo = Foo(values)
If I do this, I get the following error message: Cannot convert value of type '[UInt8]' to expected argument type 'std.__1.vector<UInt8, allocator<UInt8>>'
.