I need to have a code which needs to use std::map and create a list of data types and its size. For example "BYTE" means 'unsigned char', "BOOL" means 'bool', "INT" means 'unsigned int', etc.
The input which I need to take from the user is string (datatype names) and from that I need to create the list. Once the user requests for a pointer for a specific datatype, I need to allocate memory and send the pointer back.
I found something on C++ std::map of template-class values. But I don't know how to initialize and use it. Is there an alternate way to do it. ( I am very new to template and std::map usage)
Thanks in advance.
boost::variantorboost::any. - NathanOliverstd::map? I would try to solve the problem, and ifmaphelps I would use it, but deciding to usemapbefore you know how to solve the problem isn't a good idea. - Jonathan Wakely