use C++ style cast:
static_cast< double >( total_msg[it->first] ) / static_cast< double >( it->second )