wink's

梦想总比现实闪耀,所以我一路追寻

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

摘要: 今天接触到了Go语言, 请原谅我现在才接触到Go, 之前听云风大神说起过, 但我总把它和易语言混淆了, 导致我没有更早的了解到这个语言. 就在一年多前, 那个时候的我还是对C++无比的热爱, 认为c++是做后台服务器的不二选择. 那个时候总认为c 跟 c++是一家的, 所以我总爱标榜自己为c/c++程序员. C++虽然完全兼容了C(这是优点, 也是C++致命的缺陷), 但是C++跟C的设计思想可以说是很不一样的, 具体说起来可以参见云风关于C++和C的一些讨论. 对C++的认识随着自己做聚能推项目不断加深, 我了解几乎所有c++的特性, 但说实在的, 我能用上的特性真的不多. 我也试... 阅读全文
posted @ 2014-03-27 00:59 wink's 阅读(15847) 评论(2) 推荐(0) 编辑

2013年1月8日

摘要: Important note for Visual C++ usersIf you put your tests into a library and yourmain()function is in a different library or in your .exe file, those tests will not run. The reason is abugin Visual C++. When you define your tests, Google Test creates certain static objects to register them. These... 阅读全文
posted @ 2013-01-08 21:51 wink's 阅读(283) 评论(0) 推荐(0) 编辑

摘要: msvs 9.0 默认使用的是 md, 并非mt , 故编译时请注意编译出md gtest及 mt版本 阅读全文
posted @ 2013-01-08 21:42 wink's 阅读(176) 评论(0) 推荐(0) 编辑

2012年11月21日

摘要: 转自 :http://blog.csdn.net/wingfiring/article/details/632756在查看boost::aligned_storage的实现代码时,看到,其中的两个枚举量:size和alignment,size是传入类型的sizeof, alignment则是其对齐边界。alignment = ( alignment_ == std::size_t(-1) ? ::boost::detail::aligned_storage::alignment_of_max_align : alignment_ )默认情况下alignment_参数为-1,那么就来分析一下:: 阅读全文
posted @ 2012-11-21 22:54 wink's 阅读(559) 评论(0) 推荐(0) 编辑

摘要: 以为asio用openssl要在编译的时候加上选项, 在文档里面找来找去都没找到相关的信息, 后来发现实际只要把openssl路径包进来即可, 另外记得用#prama comment 链接动态库 #include <boost/asio.hpp>#include <boost/asio/ssl.hpp>#include <fstream>using namespace std;using namespace boost::asio;#pragma comment(lib, "libeay32MTd.lib")#pragma comment 阅读全文
posted @ 2012-11-21 13:01 wink's 阅读(3896) 评论(0) 推荐(0) 编辑

2012年11月14日

摘要: http://cpp-netlib.github.com/latest/index.htmlcpp-netlib , http相关操作, 准备纳入boost, mark 一下 阅读全文
posted @ 2012-11-14 21:24 wink's 阅读(148) 评论(0) 推荐(0) 编辑

2012年10月22日

摘要: 解决: 工具---选项---调试---常规 去掉 "要求源文件与原始版本完全匹配."DEBUG无问题, RELEASE出问题的原因之一:出现类似下面的代码:assert(char *pc = malloc(100), pc != NULL); 阅读全文
posted @ 2012-10-22 09:45 wink's 阅读(187) 评论(0) 推荐(0) 编辑

2012年8月18日

摘要: 转自:http://www.math.pku.edu.cn/teachers/qiuzy/books/cppl/words.htm作者 :裘宗燕与C++相关的一些术语的翻译和问题这里讨论一些词汇的译法。在选择术语之前我都仔细想过,尽可能采用常见译法,只有在确实存在有说服力的理由时,我才决定不采用某个流行译法。也有些术语是新问题。下面是一些情况,写在这里请各位评价(起因是在china-pub书评中与读者的讨论,这里经过重新整理,增加了许多材料,以后还会不断增加新内容):关于“侵入式”(intrusive)和“非侵入式”设计将intrusive翻译为“侵入式”是我的个人选择。但“侵入式”和“非侵. 阅读全文
posted @ 2012-08-18 16:56 wink's 阅读(828) 评论(0) 推荐(0) 编辑

2012年7月30日

摘要: volatile 和 LockingPtr(原创):作者: wink声明: 此文章允许被转载, 但是请尊重作者, 请注明出处.谢谢 众所周知, 我不爱写文章, 但是今天确实很有冲动写这篇文章, 望各位看官一定注意. 下面的内容对大家多线程安全编程必有好处. 写过多线程程序的人都知道, 写出多线程安全的代码, 而且要优雅的代码, 是很困难的事. 特别是当使用STL的时候, 经常会忘记加锁, 这个问题不可谓不烦人. 下面说一种机制, 可以让编译器告知你, 你的代码有线程安全问题..听起来多么惬意的一件事情啊...是的, 本篇文章的主角就是大名鼎鼎的volatile... 先说说volati... 阅读全文
posted @ 2012-07-30 02:33 wink's 阅读(456) 评论(0) 推荐(0) 编辑

2012年7月29日

摘要: Thevolatilekeyword was devised to prevent compiler optimizations that might render code incorrect in the presence of certain asynchronous events.I don't want to spoil your mood, but this column addresses the dreaded topic of multithreaded programming. If — as the previous installment of Generics 阅读全文
posted @ 2012-07-29 22:20 wink's 阅读(279) 评论(0) 推荐(0) 编辑