http://stackoverflow.com/questions/20516773/stdunique-lockstdmutex-or-stdlock-guardstdmutex The difference is that you can lock and unlock a std::unique_lock. std::lock_guard will be locked only once on construction and unlocked on destruction. So fo…
huffman coding, greedy algorithm. std::priority_queue, std::partition, when i use the three commented lines, excution time increase to 15ms from 0ms, due to worse locality? thanks to http://acm.hdu.edu.cn/discuss/problem/post/reply.php?action=support…
/usr/include/c++/4.8/functional:1697:61: error: no type named ‘type’ in ‘class std::result_of<std::_Mem_fn<void 看的上面的错误. 之后Google 了,结合下面两个链接才解决. https://segmentfault.com/q/1010000004413576 http://stackoverflow.com/questions/28950835/c-error-no-type-…
//lamda //first lamda [] {}; // second lamda []() //or no need () when paramater is null { std::cout << "second" << std::endl; }();// last add(), express will call this lamda func // 3 with return type auto kkk = []() { return 1; }()…
There is a critical difference between std::fill and memset that is very important to understand. std::fill sets each element to the specified value. memset sets each byte to a specified value. While they won't produce incorrect results when used app…