c++ cli - Common pattern when using arrays in C++/CLI -
i experienced c++, began learn c++/cli. notice following pattern lot:
array<string^>^ x;
how guys think this? way interpret is, array of strings , want them on managed heap , why use string^, want vector on managed heap , why have
array<something>^.
correct?
c++cli ref class
must live on managed heap. actual non-managed heap instances blocked.
both string
, array
ref class
types, must live on managed heap.
c++, in order remind user these garbage-collected pointer types, , not literals or traditional pointer types, requires end types ^
.
while redundant (all instances of array<>
array<>^
-- hence in c# there no such ^
token), reminder managed type , not normal type helps when mix managed , unmanaged code.
Comments
Post a Comment