S
Steven Woody
[...]
This seems interesting! I will try right now. And, in my real
program, the elements contained in the std::vector are actually
std:air objects.
std:air of what?
If possible, I would urge you to consider replacing std:air
with a POD struct, and using either tr1::array or a C style
array with static initializers. That ensures that you will
never encounter an order of initialization problem, and will
work just as well as std::vector. (Most of the time I've used
the solution I just explained has been with std::map. And
looking something up in an std::map can be significantly faster
than using a linear search over an array. Although... unless
the number of elements is large, the difference often isn't
important.)
--
James Kanze (GABI Software) email:[email protected]
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Ok, I understand. Defining a POD structure instead of using a
std:air should work. But the point is, also without std::vector, is
it?
By the way, my std:air is <int, int>, as simple as you guessed