Add C++03 version
Adapt code to article: threshold becomes "<="