![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
[编程]C++
文章平均质量分 61
yan_onion
这个作者很懒,什么都没留下…
展开
-
段1
struct SampleItem{ Sample* (*create)(); const char* name;};Sample* createSolo() { return new Sample_SoloMesh(); }Sample* createTile() { return new Sample_TileMesh(); }Sample* createTempObstacl转载 2013-11-29 17:23:04 · 635 阅读 · 0 评论 -
让std::set反向排序
struct tstring_reverse_sort{ bool operator()(const tstring &string1, const tstring &string2) const;};bool tstring_reverse_sort::operator()( const tstring &string1, const tstring &string2 ) const{原创 2014-01-20 13:31:00 · 2145 阅读 · 0 评论 -
C++ Programming/RTTI
原文地址:http://en.wikibooks.org/wiki/C%2B%2B_Programming/RTTIRun-Time Type Information (RTTI)[edit]RTTI refers to the ability of the system to report on the dynamic type of an object and转载 2013-10-14 14:29:16 · 721 阅读 · 0 评论 -
vector的初始化和遍历
原文地址:http://blog.csdn.net/liunian17/article/details/7435781这里只说明常用的vector初始化的方式。一般vector的初始化我还是比较习惯于像数组一样的初始化方式。一个一个赋值,或者用花括号的初始化。下面用一个程序来说明:[cpp] view plaincopy#include转载 2014-02-08 14:49:16 · 580 阅读 · 0 评论 -
类成员函数的函数指针
class Base_Op{public: virtual std::string get_name() {return std::string("Base_Op");}};typedef std::string (Base_Op::*PTRFUNC)();class Op1 : public Base_Op{public: virtual std::string get_n原创 2014-02-13 13:29:41 · 390 阅读 · 0 评论 -
c++实现delegate—模版函数指针
原文地址:http://www.cppblog.com/tonykee/archive/2008/09/29/63034.html#include "stdafx.h"#include using namespace std;templateclass A{private: typedef int (T::*delegateFun)(int); T * _This; d转载 2013-09-05 09:43:58 · 604 阅读 · 0 评论