Add another C++ solution

Avoids allocations!
Merge pull request #85 from ben0x539/another-cpp

Add another C++ solution