|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62062 - in sandbox/SOC/2010/bit_masks/boost/integer: . details
From: bbartmanboost_at_[hidden]
Date: 2010-05-17 08:56:36
Author: bbartman
Date: 2010-05-17 08:56:36 EDT (Mon, 17 May 2010)
New Revision: 62062
URL: http://svn.boost.org/trac/boost/changeset/62062
Log:
migrating runtime support funcitons into header files
Text files modified:
sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp | 38 +++++++++++++++++++++++++++++++++++++-
sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_function_support.hpp | 32 --------------------------------
sandbox/SOC/2010/bit_masks/boost/integer/details/integral_mask_support_functions.hpp | 31 -------------------------------
sandbox/SOC/2010/bit_masks/boost/integer/integral_mask.hpp | 37 ++++++++++++++++++++++++++++++++++++-
4 files changed, 73 insertions(+), 65 deletions(-)
Modified: sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp 2010-05-17 08:56:36 EDT (Mon, 17 May 2010)
@@ -51,8 +51,44 @@
}
};
+// Runtime support functions.
+
+// Overloads for bitwise and
+template <typename T, unsigned int Offset, unsigned int Width>
+inline T operator&(T t, bit_mask<T,Offset,Width> ) {
+ return t & bit_mask<T, Offset, Width>::value;
+}
+
+template <typename T, unsigned int Offset, unsigned int Width>
+inline T operator&(bit_mask<T,Offset,Width>, T t) {
+ return bit_mask<T,Offset,Width>::value & t;
+}
+
+// Overloads for bitwise or
+template <typename T, unsigned int Offset, unsigned int Width>
+inline T operator|(T t, bit_mask<T,Offset,Width>) {
+ return t | bit_mask<T,Offset,Width>::value;
+}
+
+template <typename T, unsigned int Offset, unsigned int Width>
+inline T operator|(bit_mask<T,Offset,Width>, T t) {
+ return bit_mask<T,Offset,Width>::value | t;
+}
+
+// Overloads for bitwise xor
+template <typename T, unsigned int Offset, unsigned int Width>
+inline T operator^(T t, bit_mask<T,Offset,Width>) {
+ return t ^ bit_mask<T,Offset,Width>::value;
+}
+
+template <typename T, unsigned int Offset, unsigned int Width>
+inline T operator^(bit_mask<T,Offset,Width>, T t) {
+ return bit_mask<T,Offset,Width>::value ^ t;
+}
+
+
} // namespace boost
-#include <boost/integer/details/bit_mask_function_support.hpp>
+
#endif
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_function_support.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_function_support.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_function_support.hpp 2010-05-17 08:56:36 EDT (Mon, 17 May 2010)
@@ -14,38 +14,6 @@
// Contains overloads for all of the bit wise operators which apply to bit_masks
// and applications there of.
-// Overloads for bitwise and
-template <typename T, unsigned int Offset, unsigned int Width>
-inline T operator&(T t, bit_mask<T,Offset,Width> ) {
- return t & bit_mask<T, Offset, Width>::value;
-}
-
-template <typename T, unsigned int Offset, unsigned int Width>
-inline T operator&(bit_mask<T,Offset,Width>, T t) {
- return bit_mask<T,Offset,Width>::value & t;
-}
-
-// Overloads for bitwise or
-template <typename T, unsigned int Offset, unsigned int Width>
-inline T operator|(T t, bit_mask<T,Offset,Width>) {
- return t | bit_mask<T,Offset,Width>::value;
-}
-
-template <typename T, unsigned int Offset, unsigned int Width>
-inline T operator|(bit_mask<T,Offset,Width>, T t) {
- return bit_mask<T,Offset,Width>::value | t;
-}
-
-// Overloads for bitwise xor
-template <typename T, unsigned int Offset, unsigned int Width>
-inline T operator^(T t, bit_mask<T,Offset,Width>) {
- return t ^ bit_mask<T,Offset,Width>::value;
-}
-
-template <typename T, unsigned int Offset, unsigned int Width>
-inline T operator^(bit_mask<T,Offset,Width>, T t) {
- return bit_mask<T,Offset,Width>::value ^ t;
-}
} // end of boost namespace.
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/integral_mask_support_functions.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/integral_mask_support_functions.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/integral_mask_support_functions.hpp 2010-05-17 08:56:36 EDT (Mon, 17 May 2010)
@@ -14,38 +14,7 @@
// Contains overloads for all of the bit wise operators which apply to bit_masks
// and applications there of.
-// Overloads for bitwise and
-template <typename T, unsigned int Value>
-inline T operator&(T t, integral_mask<T,Value> ) {
- return t & integral_mask<T,Value>::value;
-}
-template <typename T, unsigned int Value>
-inline T operator&(integral_mask<T,Value>, T t) {
- return integral_mask<T,Value>::value & t;
-}
-
-// Overloads for bitwise or
-template <typename T, unsigned int Value>
-inline T operator|(T t, integral_mask<T,Value>) {
- return t | integral_mask<T,Value>::value;
-}
-
-template <typename T, unsigned int Value>
-inline T operator|(integral_mask<T,Value>, T t) {
- return integral_mask<T,Value>::value | t;
-}
-
-// Overloads for bitwise xor
-template <typename T, unsigned int Value>
-inline T operator^(T t, integral_mask<T,Value>) {
- return t ^ integral_mask<T,Value>::value;
-}
-
-template <typename T, unsigned int Value>
-inline T operator^(integral_mask<T,Value>, T t) {
- return integral_mask<T,Value>::value ^ t;
-}
} // end of boost namespace.
Modified: sandbox/SOC/2010/bit_masks/boost/integer/integral_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/integral_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/integral_mask.hpp 2010-05-17 08:56:36 EDT (Mon, 17 May 2010)
@@ -38,8 +38,43 @@
}
};
+
+// runtime support functions.
+
+// Overloads for bitwise and
+template <typename T, unsigned int Value>
+inline T operator&(T t, integral_mask<T,Value> ) {
+ return t & integral_mask<T,Value>::value;
+}
+
+template <typename T, unsigned int Value>
+inline T operator&(integral_mask<T,Value>, T t) {
+ return integral_mask<T,Value>::value & t;
+}
+
+// Overloads for bitwise or
+template <typename T, unsigned int Value>
+inline T operator|(T t, integral_mask<T,Value>) {
+ return t | integral_mask<T,Value>::value;
+}
+
+template <typename T, unsigned int Value>
+inline T operator|(integral_mask<T,Value>, T t) {
+ return integral_mask<T,Value>::value | t;
+}
+
+// Overloads for bitwise xor
+template <typename T, unsigned int Value>
+inline T operator^(T t, integral_mask<T,Value>) {
+ return t ^ integral_mask<T,Value>::value;
+}
+
+template <typename T, unsigned int Value>
+inline T operator^(integral_mask<T,Value>, T t) {
+ return integral_mask<T,Value>::value ^ t;
+}
+
} // namespace boost
-#include <boost/integer/details/integral_mask_support_functions.hpp>
#endif
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