![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++&stl&boost
lpcudaid
这个作者很懒,什么都没留下…
展开
-
为什么使用boost::function绑定类成员函数时,类的析构函数不能为虚函数
这是否与模板在编译时动态绑定有关??? #include #include #include #include class CBase { public: //CBase(); //~CBase(); public: virtual void print(const std::string& vInfo) {std::cout << "bas原创 2011-12-18 16:55:52 · 491 阅读 · 1 评论 -
转发碎片备份
与 Boost.Function 一起使用 Boost.Lambda 与 Boost.Function 兼容于由 Boost.Bind 创建的函数对象一样,它也支持由 Boost.Lambda 创建的函数对象。你用 Lambda 库创建的任何函数对象都兼容于相应的 boost::function. 我们在前一节已经讨论了基于绑定的一些内容,使用 Boost.Lambda 的主要不同之处是转载 2011-12-18 17:26:23 · 275 阅读 · 0 评论 -
boost.function源码剖析
作者介绍: 侯捷,台湾著名C++技术专家,两岸著名IT技术教育者,计算机图书作家/译者/书评人。深入了解企业一线实践,挖掘C++技术难点与要点,有多年的企业客户培训经验,其深度的技术剖析和丰富的案例教学,深受企业及C++开发者的广泛好评。 曾翻译众多高阶技术书籍,包括Meyers所著之“Effective C++”系列。擅长以容易理解的图片解析繁复的结构和过程,以深入浅出的方式阐述高深的技转载 2011-12-17 18:16:14 · 622 阅读 · 0 评论 -
理解各种不同含义的new和delete
理解各种不同含义的new和delete 人们有时好像喜欢故意使C++语言的术语难以理解。比如说new操作符(new operator)和operator new的区别。 当你写这样的代码: string *ps = new string("Memory Management"); 你使用的new是new操作符。这个操作符就象sizeof一转载 2011-12-17 17:31:51 · 292 阅读 · 0 评论 -
以boost::function和boost:bind取代虚函数
以boost::function和boost:bind取代虚函数 转自:http://blog.csdn.net/Solstice/archive/2008/10/13/3066268.aspx 这是一篇比较情绪化的blog,中心思想是“继承就像一条贼船,上去就下不来了”,而借助boost::function和boost::bind,大多数情况下,你都不用上贼船。转载 2011-12-17 18:40:50 · 444 阅读 · 0 评论 -
boost::bind boost::function绑定万能函数测试2(类成员函数和虚函数)
#include #include #include #include class CParameter { public: CParameter() : m_StrInfo("CParameter") { m_VecInt.push_back(1); m_VecInt.push_back(2); m_VecInt.push_back(3); } ~CPa原创 2011-12-19 12:35:28 · 566 阅读 · 0 评论 -
万能函数第一版本-针对个数确定参数(第二版本实现参数不定)
#include #include #include void function0(int vParam0, int vParam1) { std::cout } void function1(std::string vParam0, float vParam1) { std::cout } template void excut原创 2011-12-18 20:53:02 · 388 阅读 · 0 评论 -
C++ 实现IDL原码研究
// asgard_test.cpp : Defines the entry point for the console application. // #include #include #include #include #include using namespace std; class NullType { NullType ();转载 2012-01-19 00:29:26 · 422 阅读 · 0 评论