Skip to Main Content
Perplexed Owl Random Ponderings

Benjamin ‘Benilda’ Key:

YekNeb: C++ Code snippets library


YekNeb is an open source code snippets library maintained by Ben Key. It is provided in the same tradition as the venerable, and unfortunately no longer maintained, SNIPPETS collection that was once maintained by Auke Reitsma and was available at snippets.org and can now be found at archive.org.

Most of the code snippets are designed to be cross platform, that is they are designed to support Microsoft Windows, Mac OS X, and GNU/Linux. However, some of the code snippets may only support Microsoft Windows. Any code snippets that are not cross platform will be clearly marked as such.

Some of the code snippets will be accompanied by articles describing their motivation and their implementation. Others may be supplied without this supporting documentation. All code snippets will at the very least be mentioned in this document.

Using Character or String Constants in a Template function

This article provides several techniques that may be used when creating template functions in which the character type is a template parameter and you must use character or string constants.

Cross Platform Conversion Between string and wstring

This article describes a cross platform method of converting between a STL string and a STL wstring that does not depend on any third party libraries of operating system specific APIs.

Variable Expansion in Strings

This article describes several existing options for expanding variables in strings containing place holders to build a new string in which the place holders have been replaced with the values of the variables.

It also describes the two possible implementations of a function that may be used for this purpose.