I heard that volatile is factor of overloading like const.
If a function is overloaded by volatile parameter, when is the volatile-version called?
I can\'t i
Write a test program to find out.
void func(const int& a)
{
std::cout << "func(const)" << std::endl;
}
void func(const volatile int& a)
{
std::cout << "func(const volatile)" << std::endl;
}
int main()
{
const int a = 0;
const volatile int b = 0;
func(a);
func(b);
system("pause");
return 0;
}
will output:
func(const)
func(const volatile)