There is no such assignment because there are many cases where it doens't make sense. What would you expect the result of the following to be?
Code: Select all
const core::dimension2d<s32> di(-1, -1000)
const core::dimension2d<u32> du(di);
printf ("du.X = %u du.Y = %u\n", du.X, du.Y);
Would you expect the conversion to generate a warning about truncation of a signed value? If such a warning happened, would you expect the problem be fixed in Irrlicht? Assume that someone fixed the warning in Irrlicht code. Now someone else uses it and their code compiles cleanly but has a subtle error introduced by this conversion. What should happen now?
Also, consider that allowing conversion from one template type to another opens the door for other conversions. You want the conversion from
core::dimension2d<s32> to
core::dimension2d<u32>, but what about the other way around? What about implicit conversion between
core::dimension2d<f32> and
core::dimension2d<u8>? Is that desireable? Without some interesting template tricks, it is not easy to limit conversions that users might not want.
The library maintainers have no way to determine if these conversions are beneficial to the user. It is _usually_ best to force the user to explicitly say what he wants instead of allowing something to happen silently. Especially if the allowing it silently has negative side effects.
Travis