Created
April 15, 2015 16:16
-
-
Save dojeda/e44426f5d69d49fa4c92 to your computer and use it in GitHub Desktop.
TIL about trigraphs in C and C++. Wat the fk!
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 <vector> | |
#include <iterator> | |
using namespace std; | |
int main(int , char *[]) { | |
vector<int> v1 = {0,1,2}; | |
vector<int> v2 <%v1<:0:>,not v1<:1:>?2:1,2%>; | |
copy(v2.begin(),v2.end(),ostream_iterator<int>(cout,",")); | |
cout << endl; | |
copy(v1.begin(),v1.end(),ostream_iterator<int>(cout,",")); | |
cout << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment