I'm trying create some Dictionary in Borland 2010 C++.
TDictionary__2<AnsiString, AnsiString> *d = new TDictionary__2<AnsiString, AnsiString>();
I got error: [BCC32 Error] Generics.collections.hpp(542): E2347 Parameter mismatch in read access specifier of property Items
what I do wrong?
C++Builder can only consume instances of Delphi-based Generics types, like TDictionary
, that originate from Delphi code. Unfortunately, it cannot instantiate Delphi-based Generics types. If you are not trying to interact with Delphi code, then you should use the STL's std::map
class instead:
#include <map>
std::map<AnsiString, AnsiString> d;