[mpl] unexpected behaviour of mpl::add

Hi, I just noticed something i find very odd. Considering this example: mpl::add<mpl::int_<1>, mpl::int_<1>::type So I was expecting that this metafunction returns a mpl::int<2> Unfortunately, this was not the case, instead a mpl::integral_c<int, 2> was returned. Is this a bug or a feature? Regards, Thomas

AMDG Thomas Heller wrote:
I just noticed something i find very odd. Considering this example:
mpl::add<mpl::int_<1>, mpl::int_<1>::type
So I was expecting that this metafunction returns a mpl::int<2> Unfortunately, this was not the case, instead a mpl::integral_c<int, 2> was returned. Is this a bug or a feature?
This is the expected behavior. In general, MPL makes no guarantees about the exact types resulting from operations. In Christ, Steven Watanabe
participants (2)
-
Steven Watanabe
-
Thomas Heller