
Aleksey Gurtovoy <agurtovoy@meta-comm.com> writes:
I haven't had a chance to look at it in detail yet, but I'm pretty sure that the penatly comes from simply _instantiating_ the vector type with a huge number of elements. 'begin' just happened to be the first metafunction that causes that in Arkadiy's code. Of course that doesn't mean that it's not an issue, especially since we guarantee that "predefined" content specification has amortized constant time complexity. At the very least, if we find out that there is nothing we can do, the docs would need to be fixed.
According to the tests we did for "C++ Template Metaprogramming," there is no cost associated with argument arity except on GCC and Comeau, where the cost rises linearly with N So, on those compilers, expect that first instantiation of a long vector template will be expensive. That said, I see no reason why we need to be causing any instantiation. Everything *could* be done by partial specialization matching, though it might be verbose to account for the numbered and unnumbered forms. -- Dave Abrahams Boost Consulting www.boost-consulting.com