On 15 avr, 19:40, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
kathy wrote:
[...]
how many layer the vector can be?
Many. The limitation should be documented in your compiler
manual.
From a quality of implementation point of view, probably, but
I'm not sure that the standard requires that the implementation
limits be documented. In practice, the most I think you'll find
is how deep templates can be nested. And since you don't know
how deep the implementation of std::vector nests them already,
that doesn't advance you much.
If the error is due to template nesting, some compilers have
options to increase it. (Early implementations of templates
often made it artificially low, since the typical case was
unintentional recursion, without a specialization to stop it. I
think that these restrictions are being raised, because the only
way to implement a loop in template metaprogramming is via such
recursion.)
--
James Kanze (GABI Software) email:ja*********@gmail.com
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