Created
October 19, 2012 10:29
-
-
Save nicolasff/3917404 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <algorithm> | |
using namespace std; | |
string operator "" _rev(char const *p, size_t sz) | |
{ | |
string rev(p, sz); | |
reverse(rev.begin(), rev.end()); | |
return rev; | |
} | |
int main() | |
{ | |
cout << "hello world"_rev << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment