积少成多

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

09 2016 档案

摘要:#include #include class Woman; class Man{ private: std::weak_ptr _wife; //std::shared_ptr _wife; public: void setWife(std::shared_ptr &woman){ _wife = woman; } v... 阅读全文
posted @ 2016-09-28 15:11 x7b5g 阅读(799) 评论(0) 推荐(0)

摘要:#include <iostream> using namespace std; class Singleton { public: static Singleton *GetInstance() { if (m_Instance == NULL) { m_Instance = new Single 阅读全文
posted @ 2016-09-28 10:03 x7b5g 阅读(350) 评论(0) 推荐(0)

摘要:#include<iostream> using namespace std; // 定义仅由HasPtr类使用的U_Ptr类,用于封装使用计数和相关指针 // 这个类的所有成员都是private,我们不希望普通用户使用U_Ptr类,所以它没有任何public成员 // 将HasPtr类设置为友元, 阅读全文
posted @ 2016-09-19 12:01 x7b5g 阅读(630) 评论(0) 推荐(0)

摘要:怎么处理一行空格中的逗号, 使用c++的方法,可以这么处理: #include <sstream> #include<algorithm> using namespace std; 将数据放入string dataline中, replace(dataline.begin,dataline.end( 阅读全文
posted @ 2016-09-12 21:17 x7b5g 阅读(1827) 评论(0) 推荐(0)

摘要:http://www.cnblogs.com/tianyajuanke/archive/2013/02/16/2610276.html 通用步骤: 编译时,可以不知钉头文件,如果指定头文件,其作用是当此头文件变化时,重新生成该规则。如果不知道头文件,则当头文件改动时,只能先clean再make。 编 阅读全文
posted @ 2016-09-12 14:56 x7b5g 阅读(279) 评论(0) 推荐(0)

摘要:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of Sis 1000, and there exists one unique longest 阅读全文
posted @ 2016-09-07 22:01 x7b5g 阅读(170) 评论(0) 推荐(0)