Keyword Arguments in C++

I previously discussed the mixin technique for C++, where layers are used to construct types from reusable classes. As the stacks of layers grow in size, it becomes tedious to pass arguments to the different layers. At first, I used a big struct to hold each an every argument I ...

more ...

Mixin Layers with C++

I would like to highlight a technique in C++ called mixin layers and present a use case, where it is very useful.

Mixin layers is a template-based design, where the layers are used a building blocks to quickly construct applications with reusable code. My favourite example is a networking application ...

more ...

Receiving UDP Packets in Promiscuous Mode

One of my colleagues needed to sniff UDP packets from two other nodes in the wireless ad-hoc network, so I cooked a header file for him, along with a small usage example.

My first attempt used the obsolete AF_INET and SOCK_RAW protocol arguments to the socket call, but this didn ...

more ...

Debugging Memory Bugs Using Address Sanitizer

Yesterday, I encountered a very subtle bug that did not make sense and obviously was an effect of a memory fault somewhere else in my code.

rlnc_multipath: src/buffer_pkt.hpp:62: void buffer_pkt::reset(): Assertion `&m_buffer[0]' failed.

How can a reference to the first element of a std::vector ...

more ...