I'm trying to programmatically create and track objects but have been unable to in a C++ CLI application. I've tried using vector and the CLI equivalent cliext, both of which threw errors. In a normal C++ application, I have had no problem creating a set of objects and retrieving data from them using std::vector<Player> player(8)
, with Player
being the class, player
being the reference, and (8)
being the number of objects. To store data, or retrieve, I can then just run the method for that class player[4].SetColor(22);
. It seems that CLI is expecting managed code, which cliext should handle, but I have run into errors when running it that way as well:
Severity Code Description Project File Line Suppression State
Error C4484 'cliext::impl::vector_select<_Value_t,true>
::default::get': matches base ref class method
'cliext::impl::vector_impl<_Value_t,true>::default::get',
but is not marked 'virtual', 'new' or 'override'; 'new'
(and not 'virtual') is assumed
and:
Severity Code Description Project File Line Suppression State
Error C3673 'Player': class does not have a copy-constructor
Though like I said, runs fine without CLI.
Any help/examples for CLI would be appreciated, thanks!