Eric Niebler wrote:
Eric Niebler wrote:
There's another consideration that I've been glossing over. mpl::string isn't *really* random access. Since mpl::string<'a','b','c'> designates the same character sequence as mpl::string<'abc'>, it takes O(N) template instantiations to find the N-th element in the sequence, at least in the current implementation. I'd like to fix that, but I don't know how (yet).
Now this is really bothering me. The right thing to do is replace the current implementation with one in which mpl::string is a front- and back-extensible bidirectional sequence, and give up with the random access pretense. :-(
I've made this change. mpl::string is no longer random access (it never really was). Also, I've changed c_str to be a separate metafunction that works with any forward sequence. Thanks particularly to Noah Roberts for the good feedback. -- Eric Niebler BoostPro Computing http://www.boostpro.com