Boost logo

Boost Users :

Subject: [Boost-users] type_erasure question
From: Aleksandar Fabijanic (aleskx_at_[hidden])
Date: 2013-04-07 11:40:32


Looking at the type_erasure example:

typedef any<boost::mpl::vector<copy_constructible<>,
        typeid_<>, addable<>>
> any_type;

any_type x(1.1);
any_type y(1);
any_type z(x + y);

Apparently, without placeholders for x and y, this is undefined behavior.
Am I interpreting it right? If so, shouldn't it fail to compile or at least
throw an exception at runtime?

Thanks,

Alex



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net