I have a structure in my program
struct secret_structure{ string a; string b; void *c; };
I have a list of such structures
std::map<string name, secret_structure> my_map
I need to write a function that returns a structure by matching it with a name.
get_from_map(string name, secret_structure * struct)
I have the following options:
Pass the pointer of the secret structure to the get_from_map function. The get_from_map structure fills the structure. I do not want to do this because the structure will be exposed.
I can have different functions to return different values ββfrom a structure. Here the structure will not be displayed, but does not look clean.
Can you help me with any other option so that the structure itself is not shown.
source share