M
Michele 'xjp'
Hi,
I need a data structure (better if in STL) what give me:
- an auto generated auto-increment integer field ('id')
- various string fields
This structure data must be searchable: I must be able to search any of
the fields using a string (or a int if I search the 'id').
This is equal to a record in a database, with the searchable property.
To implement this, I was thinking to use STL's map<int, container>
The container is a structure data (defined by me) that contains the
various string fields. The key of the STL's map will be the number of
the times that I call map.insert(). The container itself contains also
the 'id'.
What do you think about this?
I am not sure that the container in the map will be searchable by his
fields.
Is there any way to do this in a better way?
Thanks
I need a data structure (better if in STL) what give me:
- an auto generated auto-increment integer field ('id')
- various string fields
This structure data must be searchable: I must be able to search any of
the fields using a string (or a int if I search the 'id').
This is equal to a record in a database, with the searchable property.
To implement this, I was thinking to use STL's map<int, container>
The container is a structure data (defined by me) that contains the
various string fields. The key of the STL's map will be the number of
the times that I call map.insert(). The container itself contains also
the 'id'.
What do you think about this?
I am not sure that the container in the map will be searchable by his
fields.
Is there any way to do this in a better way?
Thanks