From 0bec4eb61d479d8dda1a11e93b8165ed0833b773 Mon Sep 17 00:00:00 2001 From: Martin Read Date: Wed, 6 Apr 2011 19:32:41 +0100 Subject: [PATCH] Added sign.hh to go with libmormegil::sign.3 --- include/libmormegil/sign.hh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/libmormegil/sign.hh diff --git a/include/libmormegil/sign.hh b/include/libmormegil/sign.hh new file mode 100644 index 0000000..754dbe1 --- /dev/null +++ b/include/libmormegil/sign.hh @@ -0,0 +1,19 @@ +// libmormegil/sign.hh +// +// In jurisdictions where this file would be adjuged to contain copyrightable +// material, it is copyright 2011 Martin Read, and released to the public +// under the terms of the Creative Commons Public Domain Dedication (cc-0). +// It is provided without any warranty, express or implied. + +#ifndef libmormegil_sign_hh +#define libmormegil_sign_hh + +namespace libmormegil + template inline bool sign(const T& i) + { + return (i < T(0)) ? -1 : (i > T(0)) ? 1 : 0; + } +} +#endif // libmormegil_sign_hh + +// vim:ts=8:sw=4:expandtab:fo=c -- 2.11.0