//some exceptions accept a string, so it's easy
throw std::invalid_argument("INVALID VALUE : " + std::to_string(val));
//if it only accept char* you'd have to do something like this
throw std::except( (std::string("ERROR VALUE ") + std::to_string(val)).c_str() )