Using a custom user-defined-literal for side effects - C++ Class

C++ examples for Class:Custom Literal

Description

Using a custom user-defined-literal for side effects

Demo Code

#include <iostream> 

using namespace std; 

void operator"" _countdown (unsigned long long Value) 
{ 
    for (int i = Value; i >= 0; i--) 
        cout << i << endl; /*from  w ww.ja va2  s.com*/
} 

int main() 
{ 
    10_countdown; 

    return 0; 
}

Result


Related Tutorials