value_type any_cast( any const & operand )
{
    if ( typeid(value_type) != typeid(double) )
    {
        throw bad_any_cast( typeid(value_type).name() );
    }

   return 3.14;
}
Beispiel #2
0
BOOST_TYPE_ERASURE_DECL value_type boost::type_erasure::detail::lookup_function_impl(const key_type& key) {
    ::data_type * data = ::get_data();
    ::boost::shared_lock<mutex_type> lock(data->second);
    ::map_type::const_iterator pos = data->first.find(key);
    if(pos != data->first.end()) {
        return pos->second;
    } else {
        throw bad_any_cast();
    }
}