Re: Specialising for iterators over contiguous memory (e.g. vector,
string)
On Feb 20, 6:28 pm, Phil Endecott <spam_from_usenet_0...@chezphil.org>
wrote:
Victor Bazarov wrote:
With all due respect to your effort so far, it's not enough for me
to verify that whatever you are trying to get to work does not work
and why. Please post the _complete_ _compileable_ code.
Victor, don't worry about the syntax errors and so on. I can fix those.
The important bit is this question, which does not depend on any of
the code that I posted (and which got lost in the quoting):
"I'd really like to be able to detect any container, including
user-defined ones, where the elements are stored contiguously in memory.
Is there some way to enable the specialisation in these cases?"
The answer is no. About the best you can do is to use some sort
of traits class, explicitly specialize it for pointers and the
containers you're interested in, and ask the user to specialize
it for his containers. But there's nothing in the external
interface of the iterator which will give a hint.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34