RTTI – dynamic_cast

Run-time type information (RTTI) enables determining object type during runtime. This is enabled by the following language features: This post only talks about dynamic_cast. dynamic_cast “The need for dynamic_cast generally arises because you want to perform derived class operation on a derived class object, but you have only a pointer or reference-to-base” said Scott Meyers in his […]

Linux x64 NASM Base64Encoder

In this post I present the small efficient Base64Encoder I’ve written in NASM assembler for Linux x64. This comes from a project I’ve done recently. Build instructions: nasm -f elf64 base64encode.asmld base64encode.o -o base64encode The encoder reads the data from standard input stream. For example: echo ‘Hello World!’ | ./base64encode or one can base encode […]

C++ Lambda’s – simply explained

The C++-11 brought lambda expressions, which are a convient way of defining clojures. Before C++-11 a typical way to pass function-like objects to algorithms was to define a class/struct with operator()(…). For example for sorting vector of pairs of 2 integers by the value of the second element would in C++98 look something like: Since […]