Tag Archives: C++

Lock-free programming, first steps: mostly lock-free fixed-size vector

I recently got interested in lock-free programming techniques, and began playing with the idea of a lock-free, fixed size vector. While the final result isn’t completely lock-free, it is an optimization over a naively locked version. The following is a … Continue reading

Posted in Computers | Tagged , , , | Leave a comment

Faking Dependent Types in C++

It is possible to have some kind of dependent typing in C++ using templates. The “solution” isn’t elegant or usable, but I found it mildly interesting so I’ll try to explain it here. The C++ type system with templates is … Continue reading

Posted in Computers | Tagged , | 6 Comments

A Theoretically Correct C++ Compiler

I just realized that a C++ compiler can never be theoretically correct. This follows from the fact that C++ templates are Turing Complete (no, really) and the halting problem. We can never say for sure whether a template expression is … Continue reading

Posted in Computers | Tagged , , , | 2 Comments

For those who need to Lint large projects.

For certain reasons, I had to lint a rather large autoconf based project. While running splint *.c is trivial for a small project, things can get rather convoluted with autoconf‘s intervention, notably when it comes to mentioning include directories on … Continue reading

Posted in Computers | Tagged , , | Leave a comment