Boost logo

Boost :

From: Jaap Suter (boost_at_[hidden])
Date: 2004-10-09 19:40:03


what is the easiest way to convert an mpl::sequence to an std::sequence?

I'm using such conversions a lot when unit-testing meta-code. I just wrote
two versions of algorithms, a compile-time and the runtime one, and then
compare their outputs.

I recall hearing something about mpl::for_each having defined an operator ()
for runtime purposes, but the details don't seem to be documented anywhere.

I came up with the attached code, of which the "to_compile_time" might
actually be of general interest. It's a function that converts a runtime
integer to a compile time integer. Code-generation-wise it's a horror and it
could be more generic, but it gets the job done for me. I'd like to hear if
there are more elegant solutions for this though, as it seems like too much


Jaap Suter

Boost list run by bdawes at, gregod at, cpdaniel at, john at