C++ port of garybernhardt/selecta