
On 05/16/10 16:17, Pete Bartlett wrote:
Compilation of attachment 1 with gcc-4.5, produces errors in attachment 2. When the >'#if 1' on line 24 is changed to '#if 0', it compiles OK. What am I doing wrong?
TIA.
In the second "inner" instantiation of seq_size (ie the one taking in an empty sequence), what return type /could/ pop_front have? So intuitively a compile error is what I would expect here - and I think a literal reading of the documentation agrees because an empty sequence does not satisfy the fusion Sequence concept.
Thanks Pete. However, I was hoping the test, !empty(a_seq), would prevent executing pop_front on an empty sequence. I guess that the compiler goes ahead and instantiates it and that's what's causing the problem. But how else would one calculate the length of a sequence? (Note, I know there's already a function, size, doing this. I'm just trying to figure out how to do something like that.) Hmm... maybe I should look at size implementation? -regards, Larry