Posts

Showing posts from December, 2016

Coding: HOT UPDATE: Added tricks about REGEX, Raw Strings,...

Coding: HOT UPDATE: Added tricks about REGEX, Raw Strings,... : HOT UPDATE: Added tricks about REGEX, Raw Strings, User-defined Literals. As a whole new section! WARNING: Many of these things belong t...
HOT UPDATE: Added tricks about REGEX, Raw Strings, User-defined Literals. As a whole new section! WARNING: Many of these things belong to C++11 so use C++11 in order to test anything here :) I just write a short version for this article, because it's now in the main page. I recommend you to click on "Read more »" and read more :) Here is a short trick for the short version: I see lots of programmers write code like this one: pair < int , int > p ; vector <int> v ; // ... p = make_pair ( 3 , 4 ); v . push_back ( 4 ); v . push_back ( 5 ); while you can just do this: pair < int , int > p ; vector <int> v ; // ... p = { 3 , 4 }; v = { 4 , 5 }; 1. Assign value by a pair of {} to a container I see lots of programmers write code like this one: pair < int , int > p ; // ... p = make_pair ( 3 , 4 ); while you can just do this: pair < int , int > p ; // ... p = { 3 , 4 }; even a more complex