On C++, there is a way to declare a function inside a class (class’ method) as a constant function. If that is the case, the this pointer would be treated as constant pointer. Thus the function is restricted to modify any data inside its body. To declare a function as a constant function, we must […]

Read More →

Comments, believed or not, is one of important concept. It is not as crucial as logic flow in program but comment is still believed as one. Comments are portions of the code ignored by the compiler which allow programmer to make simple notes in the relevant areas of the source code. Comments come either in […]

Read More →

Set operations are operations over a set. In this article we will discuss about how to perform some set operation with integer and bit operation. With this we can do at most 32 member on a single set (32 is the total number of bit on 32-bit machine). But before that, let’s check the basic […]

Read More →

C++11 has bring some nice usability improvements to the language. It removes unnecessary typing and other barriers to getting code written quickly. One example we’ve already covered is the new meaning of the auto keyword; now I’d like to talk more about the range-based for loop–both how to use it, and how to make your […]

Read More →

A function pointer is a variable that stores the address of a function that can later be called through that function pointer. This concept is interesting and really useful because functions encapsulate behavior. For instance, every time you need a particular behavior such as drawing a line, instead of writing out a bunch of code, […]

Read More →

One of the most exciting features of C++11 is ability to create lambda functions or lambda closures. What does it mean? A lambda function is a function that you can write inline in your source code (usually to pass in to another function, similar to the idea of a function pointer). With lambda, creating quick […]

Read More →

Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions. The use of templates can be thought […]

Read More →