kuhar's multipurpose utilities (C++)