
"Peder Holt" <peder.holt@gmail.com> wrote
With my previous implementation, the next available compile time constant was included in the encoding and decoding structs, forcing new instantiations to be created for every typeof This has now been fixed.
What I totaly don't understand is how you can get the compiler reuse templates, and still set the compile-time variables. As far as I understand, setting a compile-time variable is a side-effect of a template instantiation, which IMO contradicts the reuse...
The parts that can be reused, are: - much of the scheme for registering templates with integral constants
I agree here.
- All the decoding stuff (with different iterators)
Are you going to make an MPL sequence from compile time variables?
The difference in encoding is basically that of iterators as well,
My input to the encode struct is 2 integers (which are incremented at each step) Arkadiys input to the encode struct is a vector of integers. But I agree, the difference between encoding is rather large, and it may be more confusing than not to make a single implementation of it.
We would most likely end up with, instead one big #ifdef switch, a dozen #ifdef switches in every file... Regards, Arkadiy