|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62436 - sandbox/SOC/2010/bits_and_ints/boost/integer
From: muriloufg_at_[hidden]
Date: 2010-06-04 19:27:31
Author: murilov
Date: 2010-06-04 19:27:30 EDT (Fri, 04 Jun 2010)
New Revision: 62436
URL: http://svn.boost.org/trac/boost/changeset/62436
Log:
Added some comments in sign.hpp
Text files modified:
sandbox/SOC/2010/bits_and_ints/boost/integer/sign.hpp | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/sign.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/sign.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/sign.hpp 2010-06-04 19:27:30 EDT (Fri, 04 Jun 2010)
@@ -18,6 +18,11 @@
namespace boost
{
+
+/*
+ * If T is the type of data and T is a signed type,
+ * sign(data) will call this function.
+ */
template <typename T>
inline typename enable_if<is_signed<T>, int>::type
sign(T data)
@@ -36,10 +41,14 @@
return is_negative | is_positive;
}
+/*
+ * If T is unsigned, this function will be called.
+ */
template <typename T>
inline typename enable_if<is_unsigned<T>, int>::type
sign(T data)
{
+ // Just return 0 if data = 0 or 1 otherwise
return int(!!data);
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk