随笔分类 -  C++

摘要:(转自) http://moodycamel.com/blog/2013/a-fast-lock-free-queue-for-c++ Sharing data between threads in annoying. Really annoying. If you do it wrong, the 阅读全文
posted @ 2017-08-05 07:23 grainy 阅读(447) 评论(0) 推荐(0)
摘要:What is the difference between ostream and ostringstream? Put succinctly: ostringstream provides a streambuf, ostream requires the user to provide one 阅读全文
posted @ 2017-07-28 05:43 grainy 阅读(2778) 评论(0) 推荐(0)
摘要:priority_queue<Point, vector<Point>, pqCmp> struct pqCmp { bool operator() (const Point& a, const Point& b) const { return distance(a,center) < distan 阅读全文
posted @ 2017-07-27 04:04 grainy 阅读(128) 评论(0) 推荐(0)
摘要:The difference here is that will place "Hello world" in the read-only parts of the memory, and making s a pointer to that makes any writing operation 阅读全文
posted @ 2017-07-26 03:58 grainy 阅读(129) 评论(0) 推荐(0)