Boost logo

Boost Users :

Subject: [Boost-users] [type_traits] Check if implicit conversion from one type to another is possible
From: Aaron Levy (aaron.levy_at_[hidden])
Date: 2014-10-29 07:34:38


Which is the correct type trait to use to check if an element of type T can be assigned to an element of type U. Is it any of the following:

boost::is_convertible<T, U>
std::is_assignable<U, T>

Now boost::is_convertible<double, int>::value is true while std::is_assignable<int, double>::value is false. What does this signify?

--
Aaron Levy
aaron.levy_at_[hidden]

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