You are currently passing the argument to theFunc by reference:


void theFunc(const double &d)