c++
文章平均质量分 80
iteye_13882
这个作者很懒,什么都没留下…
展开
-
rpath - runtime search path
RPath is a very interesting topic which can instruct the binary to find the right location of libraries and dependencies.GNU ld.so has some rules in regarding how to use the rpath to find the right d...原创 2013-04-03 11:36:07 · 181 阅读 · 0 评论 -
c++ - member template in class template
class member template can be useful in many situation. The good side of member template is that there could be infinite set of number of nested classes CL and potential infinite number of member f...原创 2012-09-26 08:19:24 · 115 阅读 · 0 评论 -
c++ template class and the pattern to use its friends
template class may defined their friends template function, friend function or even friend class to aid it provide some functions. But normally how do you implements the with the friends? Let...原创 2012-09-25 23:47:45 · 139 阅读 · 0 评论 -
c++ - Friend declaration in class Template
There are three kinds of friends declaration that may appear within a class template. A nontemplate friend class or friend function. /** - A nontemplate friend class or friend function.*...原创 2012-09-25 08:47:19 · 161 阅读 · 0 评论 -
c++ - class template default parameters
the template has parameter, it can contains type paramter and it can also have nontype paramter, in the following code. template <class Type, int size>class Buffer; the class tem...原创 2012-09-25 08:18:53 · 115 阅读 · 0 评论 -
c++ - operator new and delete and an example of linked list stores by new/delete
The operator new and delete operator can overloaded to achieve some customed memory management strategy, suppose we have a Sscreen object, and we want to allocate a chunk of memory instead of allocate...原创 2012-09-24 07:53:34 · 91 阅读 · 0 评论 -
c++ - delete(void *, size_t) or delete(void *)
In my previous dicuss, we have seen the example of overloaded delete and new operator. and as a matter of fact, we have seen the following signature of the delete operator. void operator delet...原创 2012-09-24 07:18:18 · 421 阅读 · 0 评论 -
c++ - placement operator new() and the operator delete()
A class member operator new() can be overloaded. Provided that each delcaration has a unique paramter list. The first parameter of any class operator new() must always be a parameter of type size_t, f...原创 2012-09-23 15:22:40 · 100 阅读 · 0 评论 -
c++ - overloaded subscript operator - []
You can overload the subscript operator, a typical scenario that you may use the subscriptor overload operator is when you design the String class, where you want the user to access the element at ith...原创 2012-09-23 08:50:31 · 224 阅读 · 0 评论 -
c++ - the overloaded pointer operator
YOu can overload the -> or the * operator, which is callled the reference and dereference operator separtely... You can overload the operator if you see necessary, here is soem cdoe shows how y...原创 2012-09-22 22:59:27 · 124 阅读 · 0 评论 -
c++ - initialize object array on the heap
Follow our previous discussion of how to initialize the object array in this post - c++ - object array intializer in c++ , We said that the if we use the new operator to allocate objects array on the ...原创 2012-09-22 20:43:54 · 122 阅读 · 0 评论 -
c++ - template specialization and partial specialization
in this post, we are going to examining partialization. There are two kind of partialization, one is full specialization, and the other is partial specialization. full specializationpartial...原创 2012-09-26 22:38:06 · 167 阅读 · 0 评论 -
c++ - vritual function and default arguments
As we all know that we virtual function does not overload an existing function, but rather it reuse the same member method and the right method to be invoked is determined at runtime. So, here ...原创 2012-09-27 08:56:48 · 89 阅读 · 0 评论 -
C++ - autogenerated copy constructor and assignment operator gotchas
It has been changed that the semantic of the copy constructor and the assignment operator in the relationship with class hierarhcy from vs10 to vs12...one case of the gotchas is like this:#include ...原创 2013-01-24 13:32:09 · 111 阅读 · 0 评论 -
不安装Visual Studio,只用Windows SDK搭建VC环境
首先你需要下载的是Microsoft Windows SDK for Windows 7 and .NET Framework 4. 下载以后你得到的是一个网络安装文件,确保网络的连接,安装Windows SDK 7.1 (注意得到的Windows SDK 版本是7.1,这和我们安装Vsiual Studio得到的SDK 版本v7.0A是不一样的); 安装界面如下: 安装结束以后...原创 2013-12-31 21:52:34 · 1336 阅读 · 0 评论 -
c++ - rethrow a exception gotchas
As in my prevoius example in java - common practice to rethrow exceptions, we have seen that it is always good to rethrow an new exception with the old exception as its inner exception, and it is not...原创 2012-12-23 10:57:03 · 136 阅读 · 0 评论 -
c++ -typeid operator
typeid is the one of the meager offering of runtime type information hierarchy functionality. what it offers is the ability to determine at runtime the real type of an object (a pointer is a special t...原创 2012-10-15 22:30:04 · 119 阅读 · 0 评论 -
c++ - dynamic_cast revisit
There are several built-in type of cast that is available, they are reinterpret_caststatic_castdynamic_castin tihs topic let's take a close look at the dynamic_cast. why do we need the...原创 2012-10-14 21:21:04 · 86 阅读 · 0 评论 -
c++ - virtual inheritance example 1
we have discussed the virtual inhertiance in general in the post - C++ - virtual inheritance . In this post we are not going to discuss the theory but instead we are going to show you an example so th...原创 2012-10-14 15:25:18 · 94 阅读 · 0 评论 -
c++ - virtual inheritance
As we have discussed in the post - c++ type of inheritance, we have covered private inheritance (a.k.a ) implementation inheritance, protected inheritance and public inheritance (a.k.a type inheritanc...原创 2012-10-12 08:58:53 · 145 阅读 · 0 评论 -
c++ type of inheritance
There are 3 types of inheritances in classes inheritance in C++; they are public inheritance protected inheritanceprotected inheritance as for the synonym of the type of inheritances, p...原创 2012-09-28 08:58:28 · 155 阅读 · 0 评论 -
c++ - vritually virtual new
Let's see what if we want to clone some thing when virtual and class hierarchy is considered. // it is ok if we know in advance what is the type of object we are cloning.NotQuery *pnq;NotQu...原创 2012-09-27 23:59:38 · 117 阅读 · 0 评论 -
c++ - virtual destructor
As we all know that virtual destructor is an essential part of object lifecycle management. so without further adieu, let first see the examples. class Query{protected: virtual ~Quer...原创 2012-09-27 22:01:07 · 98 阅读 · 0 评论 -
c++ - a sample class to show common aspects of object initialization/uninit
The following classes show many a apsect of object life-cycle management, including the single argument constructor, copy constructor, default constructor, expclit constructor, destructor and the non...原创 2012-09-22 20:15:28 · 90 阅读 · 0 评论 -
c++ - object array intializer in c++
In my previous post - we have discussed on the topic of c++ - copy constructor and the initializer constructor in container and array. Now, since we have conver the destructor and construcotr ...原创 2012-09-22 20:03:33 · 111 阅读 · 0 评论 -
c++ - exception specification follow up discussion
In previous - respot - c++ - A programmatic look at the exception specifications, I discusshe exception specification, which as described as the shadow type exception; here, I am going to show ...原创 2012-09-01 17:27:32 · 175 阅读 · 0 评论 -
respot - c++ - A programmatic look at the exception specifications
When I looked at the exception handlings, I am quit confused, as it is is not a full-blown exception system, and it does not have very good way to embedded the exception specification to the system. ...原创 2012-09-01 16:46:42 · 321 阅读 · 0 评论 -
c++ - exception catch all handler
this is a code that shows how you do the catch all exception handler in C++; it may sound platitude, but C++ lacks of the type system which dictate that all the excpetion should derive from the Exc...原创 2012-09-01 10:40:41 · 360 阅读 · 0 评论 -
c++ function try block
function try block is a block which the entire body of the function body is encosed in a try cluase block; for better illustration, let see some examples which can better serve for our dicussion p...原创 2012-09-01 10:14:49 · 287 阅读 · 0 评论 -
c++ - template function the compilation model correctum
In the book - the C++ Primer 3rd edition, Stanley Lippman has introduced something about the compilatio model . He introduced two models. inclusion compilation model separation compilation mod...原创 2012-08-30 23:01:16 · 114 阅读 · 0 评论 -
c++ - template function overloading
Function template overload It is not surprise that function templatealso has the overloading ability Let’s first see some examples that showshow the overloading happens. template <ty...原创 2012-08-30 21:19:31 · 114 阅读 · 0 评论 -
c++ - template function specialization
In this post, we are going to discuss the template function specialiation ;so what is "template function specialiation"? given an example, for the following function template template ...原创 2012-08-29 23:00:25 · 240 阅读 · 0 评论 -
c++ - const and its position w/o pointers or references are present
In C++, the poisition of const has special rules with/without the pointer is present. Let's first see some examples that shows that the position of the const is irrelevant in terms of reference or...原创 2012-08-27 21:37:20 · 127 阅读 · 0 评论 -
c++ - template non-type parameter and template instantiation
in C++, there are function template, where you can have two type of template paramters, one is normal template parameter, which stands for a type, while the other is a template non-type parameter, whi...原创 2012-08-26 22:16:22 · 147 阅读 · 0 评论 -
c++ - argument type conversions
During the step of function overload resolution, the compiler identifies and ranks the conversion that can apply to each argument in a function call to convert to the type of the corresponding paramet...原创 2012-08-26 22:00:09 · 402 阅读 · 0 评论 -
c++ - copy constructor and the initializer constructor in container and Array
we know you can define constructor and the copy constructor for a user defined class, and if you faile to provide one, the compiler will be able to generate one for you. The generated ones are called...原创 2012-09-04 21:55:46 · 99 阅读 · 0 评论 -
c++ generic algorithm common examples
When reading the article by Lippman Stanley, I come across the example on the chpater 12 where it has discussed the topic of generic algorithm; algorithm is a chapter that introduce the common use...原创 2012-09-09 22:13:49 · 80 阅读 · 0 评论 -
c++ - c++ explicitly call the destructor
Destructor server primarily to relinquish resources acquired either within the constructor or during the lifetime. the lifetime of the class object, again such as freeing a mutal exclsion lock or d...原创 2012-09-19 22:50:23 · 189 阅读 · 0 评论 -
c++ - union and the bitfields
C++ has some good compatability with the C language, which offers good support for low-level machine level programming construct, the union and the bitfield are two examples of such... Union ...原创 2012-09-16 20:45:18 · 114 阅读 · 0 评论 -
c++ - c++ pointer to member classes
you can define members to class members, either classes data members or class method members. there is onething that makes the pionter to member function different from other normal ponters. ...原创 2012-09-16 16:22:44 · 125 阅读 · 0 评论