Is this possible: map of references (map<string&, string&>)

A

asclearuc

Hello

Is it possible to use map<string&, string&>?

Why I need it. I have a large amount of data obtained from XML file.
I should do processing of this data.

The processing takes many stages, and could be done using std::map
templates. But new instance of std::map is required on each stage.

I would like to avoid additional memory allocation which is done in
map<string, string> case.

I would like to use smth like map<string&, string&> - in this case
there is no need to write additional binary operator
to be used as predicate for map (which would be required if I use
map<string*, string*>)

The questions are:
1. is it possible
2. are any underground problems if I use it

Would like to hear guru comments on it...

Tx,
Alexandru
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top