Zebra Codes

Writing Generator Functions in C++

19th November, 2023
C++

Many languages have the ability to let you create generators: a function that can be called multiple times, picking up where it left off and returning a different value each time. Unfortunately C++ does not give you this functionality, however that doesn’t mean that we can’t implement it ourselves.

Read More >

OpenTelemetry Null Span Exporter

24th August, 2023

The OpenTelemetry C++ implementation ships with several exporters for outputting your recorded traces: ostream, HTTP, gRPC, and more. It does not, however, provide a null implementation.

A null exporter is useful in test environments, where you just want to discard instrumentation data. The simple class below provides an implementation of a null span exporter.

Read More >

Building Redis++ with CMake

14th June, 2023

Redis++ is the recommended C++ binding for connecting to a Redis server from a C++ application, however its build script is not entirely friendly towards CMake. It relies upon hiredis, but the make script expects it to already be compiled on the system.

Read More >