I have
auto result = std::is_convertible
< boost::optional<int>
, bool
>::value;
static_assert( result , "task should return bool" );
and it fails to compile. The definition of std::is_convertible is
template< class From, class To > struct is_convertible;
and optional is clearly convertible to boolean because we always use it like
void(boost::optional<int> const & value){
if(value){
std::cerr << *value << endl;
}
}
what am I missing here?