<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[armman的专栏]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/armman</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; armman]]></copyright><item><title><![CDATA[标准C＋＋类std::string的内存共享和Copy-On-Write技术]]></title><link>https://blog.csdn.net/armman/article/details/1741261</link><guid>https://blog.csdn.net/armman/article/details/1741261</guid><author>armman</author><pubDate>Mon, 13 Aug 2007 20:21:00 +0800</pubDate><description><![CDATA[ 1、             概念 Scott Meyers在《More Effective C++》中举了个例子，不知你是否还记得？在你还在上学的时候，你的父母要你不要看电视，而去复习功课，于是你把自己关在房间里，做出一副正在复习功课的样子，其实你在干着别的诸如给班上的某位女生写情书之类的事，而一旦你的父母出来在你房间要检查你是否在复习时，你才真正捡起课本看书。这就是“拖延战术”，]]></description><category></category></item><item><title><![CDATA[使用Libxml2操作XML文档 ]]></title><link>https://blog.csdn.net/armman/article/details/1739289</link><guid>https://blog.csdn.net/armman/article/details/1739289</guid><author>armman</author><pubDate>Sun, 12 Aug 2007 09:24:00 +0800</pubDate><description><![CDATA[一、Libxml2介绍： Libxml2 是一个xml的c语言版的解析器，本来是为Gnome项目开发的工具，是一个基于MIT License的免费开源软件。它除了支持c语言版以外，还支持c++、PHP、Pascal、Ruby、Tcl等语言的绑定，能在Windows、Linux、Solaris、MacOsX等平台上运行。功能还是相当强大的，相信满足一般用户需求没有任何问题。二、 Libx]]></description><category></category></item><item><title><![CDATA[libxml库解析XML文件]]></title><link>https://blog.csdn.net/armman/article/details/1739281</link><guid>https://blog.csdn.net/armman/article/details/1739281</guid><author>armman</author><pubDate>Sun, 12 Aug 2007 09:03:00 +0800</pubDate><description><![CDATA[  绪论Libxml是一个有免费许可的用于处理XML、可以轻松跨越多个平台的C语言库。Libxml实现了读、创建及操纵XML数据功能。    这个指南基于一个简单的XML应用。 数据类型Libxml 定义了许多数据类型，它隐藏了杂乱的来源以致你不必处理它除非你有特定的需要。xmlChar  替代char,使用UTF-8编码的一字节字符串。如果你的数据使用其它编码，它必须被转换到UTF-8才能使]]></description><category></category></item><item><title><![CDATA[pImpl的原理]]></title><link>https://blog.csdn.net/armman/article/details/1737719</link><guid>https://blog.csdn.net/armman/article/details/1737719</guid><author>armman</author><pubDate>Sat, 11 Aug 2007 08:09:00 +0800</pubDate><description><![CDATA[城门失火殃及池鱼pImpl惯用手法的运用方式大家都很清楚，其主要作用是解开类的使用接口和实现的耦合。如果不使用pImpl惯用手法，代码会像这样：       //c.hpp        #includeclass C        {        public:            void f1();        private:           ]]></description><category></category></item><item><title><![CDATA[要求或禁止在堆中产生对象]]></title><link>https://blog.csdn.net/armman/article/details/1726876</link><guid>https://blog.csdn.net/armman/article/details/1726876</guid><author>armman</author><pubDate>Sun, 05 Aug 2007 11:05:00 +0800</pubDate><description><![CDATA[有时我们想这样管理某些对象，要让某种类型的对象能够自我销毁，即“delete this”。很明显这种管理方式需要此类型对象被分配在堆中。而其它一些时候我们想获得一种保障：“不在堆中分配对象，从而保证某种类型的类不会发生内存泄漏。”若在嵌入式系统上工作，就有可能遇到这种情况，发生在嵌入式系统上的内存泄漏是极其严重的，其堆空间是非常珍贵的。有没有可能编写出代码来要求或禁止在堆中产生对象（heap-]]></description><category></category></item><item><title><![CDATA[限制某个类所能产生的对象数量]]></title><link>https://blog.csdn.net/armman/article/details/1726738</link><guid>https://blog.csdn.net/armman/article/details/1726738</guid><author>armman</author><pubDate>Sun, 05 Aug 2007 08:48:00 +0800</pubDate><description><![CDATA[ 允许建立零个或一个对象每次实例化一个对象时，我们很确切地知道一件事情：“将调用一个构造函数。”事实确实这样，阻止建立某个类的对象，最容易的方法就是把该类的构造函数声明在类的private域：class CantBeInstantiated {private: CantBeInstantiated(); CantBeInstantiated(const CantBeInst]]></description><category></category></item><item><title><![CDATA[引用计数]]></title><link>https://blog.csdn.net/armman/article/details/1714911</link><guid>https://blog.csdn.net/armman/article/details/1714911</guid><author>armman</author><pubDate>Sun, 29 Jul 2007 13:06:00 +0800</pubDate><description><![CDATA[引用计数是这样一个技巧，它允许多个有相同值的对象共享这个值的实现。这个技巧有两个常用动机。第一个是简化跟踪堆中的对象的过程。一旦一个对象通过调用new被分配出来，最要紧的就是记录谁拥有这个对象，因为其所有者－－并且只有其所有者－－负责对这个对象调用delete。但是，所有权可以被从一个对象传递到另外一个对象（例如通过传递指针型参数），所以跟踪一个对象的所有权是很困难的。象auto_ptr这样的]]></description><category></category></item><item><title><![CDATA[将构造函数和非成员函数虚拟化]]></title><link>https://blog.csdn.net/armman/article/details/1714720</link><guid>https://blog.csdn.net/armman/article/details/1714720</guid><author>armman</author><pubDate>Sun, 29 Jul 2007 08:15:00 +0800</pubDate><description><![CDATA[  构造函数虚拟化    从字面来看，谈论“虚拟构造函数”没有意义。当有一个指针或引用，但是不知道其指向对象的真实类型是什么时，可以调用虚拟函数来完成特定类型（type-specific）对象的行为。仅当还没拥有一个对象但是又确切地知道想要的对象的类型时，才会调用构造函数。那么虚拟构造函数又从何谈起呢？     很简单。尽管虚拟构造函数看起来好像没有意义，其实它们有非常大的用处.例]]></description><category></category></item><item><title><![CDATA[C++各大有名库的介绍(一)]]></title><link>https://blog.csdn.net/armman/article/details/1710128</link><guid>https://blog.csdn.net/armman/article/details/1710128</guid><author>armman</author><pubDate>Thu, 26 Jul 2007 20:46:00 +0800</pubDate><description><![CDATA[C++各大有名库的介绍之C++标准库　　标准库中提供了C++程序的基本设施。虽然C++标准库随着C++标准折腾了许多年，直到标准的出台才正式定型，但是在标准库的实现上却很令人欣慰得看到多种实现，并且已被实践证明为有工业级别强度的佳作。1、Dinkumware C++ Library参考站点：http://www.dinkumware.com/P.J. Plauger编写的高品质]]></description><category></category></item><item><title><![CDATA[将 type conversions应用于所有 parameters时，请声明为 non-member functions]]></title><link>https://blog.csdn.net/armman/article/details/1690007</link><guid>https://blog.csdn.net/armman/article/details/1690007</guid><author>armman</author><pubDate>Sat, 14 Jul 2007 08:49:00 +0800</pubDate><description><![CDATA[我们让 classes 支持 implicit type conversions（隐式类型转换）通常是一个不好的主意。当然，这条规则有例外，最普通的一种就是在创建数值类型时。例如，如果设计一个代表 rational numbers（有理数）的 class，允许从 integers（整数）到 rationals（有理数）的 implicit conversions（隐式转换）看上去没什么不合理的]]></description><category></category></item><item><title><![CDATA[避免覆盖（hiding）“通过继承得到的名字”]]></title><link>https://blog.csdn.net/armman/article/details/1682877</link><guid>https://blog.csdn.net/armman/article/details/1682877</guid><author>armman</author><pubDate>Sun, 08 Jul 2007 18:26:00 +0800</pubDate><description><![CDATA[ C++ 中，我们该用哪种态度对待通过继承得到的名字.事情的实质与继承没什么关系。它与作用域有关。我们都知道它在代码中是这样的，int x;                        // global variablevoid someFunc(){  double x;                   // local variable  std::cin >> x]]></description><category></category></item><item><title><![CDATA[感受Template Meta Programming]]></title><link>https://blog.csdn.net/armman/article/details/1682617</link><guid>https://blog.csdn.net/armman/article/details/1682617</guid><author>armman</author><pubDate>Sun, 08 Jul 2007 11:41:00 +0800</pubDate><description><![CDATA[  Template Meta Programming (TMP)（模板元编程）是写 template-based（基于模板）的运行于编译期间的 C++ 程序的过程。考虑一下：一个 template metaprogram（模板元程序）是用 C++ 写的运行于 C++ 编译器中的程序。当一个 TMP 程序运行完成，它的输出——从 templates（模板）实例化出的 C++ 源代码片断——随后]]></description><category></category></item><item><title><![CDATA[考虑支持一个 non-throwing swap（不抛异常的 swap）]]></title><link>https://blog.csdn.net/armman/article/details/1682502</link><guid>https://blog.csdn.net/armman/article/details/1682502</guid><author>armman</author><pubDate>Sun, 08 Jul 2007 09:08:00 +0800</pubDate><description><![CDATA[SWAP 是一个有趣的函数。最早作为 STL 的构件被引入，后来它成为 exception-safe programming（异常安全编程）的支柱和压制自赋值可能性的通用机制。因为 swap 太有用，所以适当地实现它非常重要，但伴随它的不同寻常的重要性而来的，是一系列不同寻常的复杂性。 swap（交换）两个 objects 的值就是互相把自己的值送给对方。缺省情况下，经由标准的 swa]]></description><category></category></item><item><title><![CDATA[只要有可能就推迟 variable definitions（变量定义）]]></title><link>https://blog.csdn.net/armman/article/details/1682485</link><guid>https://blog.csdn.net/armman/article/details/1682485</guid><author>armman</author><pubDate>Sun, 08 Jul 2007 08:18:00 +0800</pubDate><description><![CDATA[ 只要你定义了一个带有 constructor（构造函数）或 destructor（析构函数）的类型的变量，当控制流程到达变量定义的时候会使你担负构造成本，而当变量离开作用域的时候会使你担负析构成本。如果这一成本关联到无用变量，你就要尽你所能去避免它。 你或许认为你从来不会定义无用变量，但是也许你应该再想一想。考虑下面这个函数，只要一个 password 足够长，它就返回这个 pass]]></description><category></category></item><item><title><![CDATA[了解Inline]]></title><link>https://blog.csdn.net/armman/article/details/1682419</link><guid>https://blog.csdn.net/armman/article/details/1682419</guid><author>armman</author><pubDate>Sun, 08 Jul 2007 00:39:00 +0800</pubDate><description><![CDATA[  Inline functions 看起来像 functions，产生的效果也像 functions，它们在各方面都比 macros（宏）好得多，而我们却可以在调用它们时不招致函数调用的成本。 实际上我们得到的可能比想到的更多，因为避免函数调用的成本只是故事的一部分。编译器的优化一般说是为了一段连续的没有函数调用的代码设计的，所以当我们inline 一个函数时，我们就使得编译器对函数]]></description><category></category></item><item><title><![CDATA[若不想使用 compiler-generated functions（编译器生成函数）请明确拒绝]]></title><link>https://blog.csdn.net/armman/article/details/1682232</link><guid>https://blog.csdn.net/armman/article/details/1682232</guid><author>armman</author><pubDate>Sat, 07 Jul 2007 18:55:00 +0800</pubDate><description><![CDATA[ 房地产代理商出售房屋，服务于这样的代理商的软件系统自然要有一个 class（类）来表示被出售的房屋：class HomeForSale { ... }; 每一个房地产代理商都会很快指出，每一件房产都是独特的——没有两件是完全一样的。在这种情况下，为 HomeForSale object（对象）做一个 copy（拷贝）的想法就令人不解了。怎么能拷贝一个独一无二的东西呢？因此最好]]></description><category></category></item><item><title><![CDATA[polymorphic base classes（多态基类）中将 destructors声明为 virtual]]></title><link>https://blog.csdn.net/armman/article/details/1682136</link><guid>https://blog.csdn.net/armman/article/details/1682136</guid><author>armman</author><pubDate>Sat, 07 Jul 2007 16:32:00 +0800</pubDate><description><![CDATA[ 程序开发部中有很多方法取得时间，所以有必要建立一个 TimeKeeper base class（基类），并为不同的计时方法建立 derived classes（派生类）：class TimeKeeper {public:  TimeKeeper();  ~TimeKeeper();  ...};class AtomicClock: public TimeKeeper { ... ]]></description><category></category></item><item><title><![CDATA[谨慎使用 multiple inheritance（多继承） ]]></title><link>https://blog.csdn.net/armman/article/details/1681731</link><guid>https://blog.csdn.net/armman/article/details/1681731</guid><author>armman</author><pubDate>Sat, 07 Jul 2007 07:35:00 +0800</pubDate><description><![CDATA[触及 Multiple Inheritance (MI)（多继承）时，C++ 社区就会鲜明地分裂为两个基本的阵营。一个阵营认为如果 single inheritance (SI)（单继承）是有好处的，multiple inheritance（多继承）一定更有好处。另一个阵营认为 single inheritance（单继承）有好处，但是多继承引起的麻烦使它得不偿失。首要的事情之一是要承认当]]></description><category></category></item><item><title><![CDATA[用 member function templates 接受 "all compatible types"]]></title><link>https://blog.csdn.net/armman/article/details/1674281</link><guid>https://blog.csdn.net/armman/article/details/1674281</guid><author>armman</author><pubDate>Sun, 01 Jul 2007 20:18:00 +0800</pubDate><description><![CDATA[smart pointers（智能指针）是行为很像指针但是增加了指针没有提供的功能的 objects。例如，标准 auto_ptr 和 tr1::shared_ptr 是被应用于在恰当的时间自动删除的 heap-based resources（基于堆的资源）的。STL containers 内的 iterators（迭代器）几乎始终是 smart pointers（智能指针）；绝对不能指望用 ]]></description><category></category></item><item><title><![CDATA[通过 composition模拟 "has-a"或 "is-implemented-in-terms-of"]]></title><link>https://blog.csdn.net/armman/article/details/1673117</link><guid>https://blog.csdn.net/armman/article/details/1673117</guid><author>armman</author><pubDate>Sun, 01 Jul 2007 09:03:00 +0800</pubDate><description><![CDATA[Composition（复合）是在 objects of one type（一个类型的对象）包含 objects of another type（另一个类型的对象）时，types（类型）之间的关系。例如：class Address { ... };             // where someone livesclass PhoneNumber { ... };class Person {p]]></description><category></category></item></channel></rss>