
on Tue Oct 21 2008, "Jordans, R." <r.jordans-AT-student.tue.nl> wrote:
I've written the template myself, but I need to be able to compile it on different systems (Linux, OS-X and Windows) and I'm not sure if every compiler will like it
My code for the template is as follows:
namespace boost { namespace mpl { template <typename C, typename T, T value1, T value2> struct if_integral_c { static const T value = if_<C, integral_c<T, value1>, integral_c<T, value2> >::type::value; }; } }
template <typename C, typename T, T value1, T value2> struct if_integral_c : integral_c<T,(C::type::value?value1:value2)> {}; would be more correct and more interoperable.
But from what I've understood not all compilers like it when you use a template typename parameter as type for other template parameters
Sorry, I don't understand what you mean. -- Dave Abrahams BoostPro Computing http://www.boostpro.com