|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75084 - in trunk/libs/type_traits/doc: . html html/boost_typetraits/category/value_traits html/boost_typetraits/reference html/index
From: frederic.bron_at_[hidden]
Date: 2011-10-21 19:42:52
Author: bronf
Date: 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
New Revision: 75084
URL: http://svn.boost.org/trac/boost/changeset/75084
Log:
operator type traits: added documentation on the limitation to template classes with operator definition that does not bind with all template arguments
Text files modified:
trunk/libs/type_traits/doc/has_bit_and.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_bit_and_assign.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_bit_or.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_bit_or_assign.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_bit_xor.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_bit_xor_assign.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_complement.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_dereference.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_divides.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_divides_assign.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_equal_to.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_greater.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_greater_equal.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_left_shift.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_left_shift_assign.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_less.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_less_equal.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_logical_and.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_logical_not.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_logical_or.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_minus.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_minus_assign.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_modulus.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_modulus_assign.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_multiplies.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_multiplies_assign.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_negate.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_not_equal_to.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_plus.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_plus_assign.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_post_decrement.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_post_increment.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_pre_decrement.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_pre_increment.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_right_shift.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_right_shift_assign.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_unary_minus.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/has_unary_plus.qbk | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html | 81 ++++++++++++++++++++++++------------
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html | 36 ++++++++++++++++
trunk/libs/type_traits/doc/html/index.html | 2
trunk/libs/type_traits/doc/html/index/s11.html | 54 +++++++++++++++++++++++
trunk/libs/type_traits/doc/html/index/s12.html | 2
trunk/libs/type_traits/doc/html/index/s13.html | 2
trunk/libs/type_traits/doc/html/index/s14.html | 87 +++++++++++++++++++++++++++++++++++++++
trunk/libs/type_traits/doc/operators.qbk | 49 ++++++++++++++++++---
83 files changed, 2934 insertions(+), 79 deletions(-)
Modified: trunk/libs/type_traits/doc/has_bit_and.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_bit_and.qbk (original)
+++ trunk/libs/type_traits/doc/has_bit_and.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_bit_and.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_bit_and.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -69,6 +69,40 @@
boost::has_bit_and<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator&` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_bit_and.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator&(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_bit_and< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g&g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_bit_and< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b&b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_bit_and_assign.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_bit_and_assign.qbk (original)
+++ trunk/libs/type_traits/doc/has_bit_and_assign.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_bit_and_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_bit_and_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -69,6 +69,40 @@
boost::has_bit_and_assign<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator&=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_bit_and_assign.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator&=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_bit_and_assign< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g&=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_bit_and_assign< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b&=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_bit_or.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_bit_or.qbk (original)
+++ trunk/libs/type_traits/doc/has_bit_or.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_bit_or.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_bit_or.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -69,6 +69,40 @@
boost::has_bit_or<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator|` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_bit_or.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator|(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_bit_or< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g|g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_bit_or< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b|b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_bit_or_assign.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_bit_or_assign.qbk (original)
+++ trunk/libs/type_traits/doc/has_bit_or_assign.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_bit_or_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_bit_or_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -69,6 +69,40 @@
boost::has_bit_or_assign<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator|=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_bit_or_assign.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator|=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_bit_or_assign< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g|=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_bit_or_assign< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b|=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_bit_xor.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_bit_xor.qbk (original)
+++ trunk/libs/type_traits/doc/has_bit_xor.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_bit_xor.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_bit_xor.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -69,6 +69,40 @@
boost::has_bit_xor<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator^` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_bit_xor.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator^(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_bit_xor< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g^g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_bit_xor< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b^b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_bit_xor_assign.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_bit_xor_assign.qbk (original)
+++ trunk/libs/type_traits/doc/has_bit_xor_assign.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_bit_xor_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_bit_xor_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -69,6 +69,40 @@
boost::has_bit_xor_assign<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator^=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_bit_xor_assign.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator^=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_bit_xor_assign< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g^=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_bit_xor_assign< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b^=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_complement.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_complement.qbk (original)
+++ trunk/libs/type_traits/doc/has_complement.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -25,7 +25,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_complement.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_complement.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_complement<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator~` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_complement.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator~(const contains<T> &rhs) {
+ return f(rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_complement< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ ~g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_complement< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ ~b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_dereference.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_dereference.qbk (original)
+++ trunk/libs/type_traits/doc/has_dereference.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -25,7 +25,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_dereference.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_dereference.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -74,6 +74,40 @@
boost::has_dereference<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator*` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_dereference.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator*(const contains<T> &rhs) {
+ return f(rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_dereference< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ *g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_dereference< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ *b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_divides.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_divides.qbk (original)
+++ trunk/libs/type_traits/doc/has_divides.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_divides.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_divides.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_divides<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator/` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_divides.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator/(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_divides< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g/g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_divides< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b/b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_divides_assign.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_divides_assign.qbk (original)
+++ trunk/libs/type_traits/doc/has_divides_assign.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_divides_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_divides_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_divides_assign<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator/=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_divides_assign.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator/=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_divides_assign< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g/=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_divides_assign< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b/=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_equal_to.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_equal_to.qbk (original)
+++ trunk/libs/type_traits/doc/has_equal_to.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_equal_to.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_equal_to.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_equal_to<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator==` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_equal_to.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator==(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_equal_to< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g==g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_equal_to< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b==b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_greater.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_greater.qbk (original)
+++ trunk/libs/type_traits/doc/has_greater.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_greater.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_greater.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_greater<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator>` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_greater.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator>(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_greater< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g>g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_greater< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b>b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_greater_equal.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_greater_equal.qbk (original)
+++ trunk/libs/type_traits/doc/has_greater_equal.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_greater_equal.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_greater_equal.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_greater_equal<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator>=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_greater_equal.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator>=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_greater_equal< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g>=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_greater_equal< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b>=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_left_shift.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_left_shift.qbk (original)
+++ trunk/libs/type_traits/doc/has_left_shift.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_left_shift.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_left_shift.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -72,6 +72,40 @@
boost::has_left_shift<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator<<` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_left_shift.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator<<(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_left_shift< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g<<g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_left_shift< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b<<b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_left_shift_assign.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_left_shift_assign.qbk (original)
+++ trunk/libs/type_traits/doc/has_left_shift_assign.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_left_shift_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_left_shift_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -69,6 +69,40 @@
boost::has_left_shift_assign<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator<<=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_left_shift_assign.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator<<=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_left_shift_assign< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g<<=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_left_shift_assign< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b<<=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_less.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_less.qbk (original)
+++ trunk/libs/type_traits/doc/has_less.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_less.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_less.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_less<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator<` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_less.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator<(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_less< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g<g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_less< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b<b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_less_equal.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_less_equal.qbk (original)
+++ trunk/libs/type_traits/doc/has_less_equal.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_less_equal.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_less_equal.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_less_equal<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator<=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_less_equal.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator<=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_less_equal< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g<=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_less_equal< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b<=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_logical_and.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_logical_and.qbk (original)
+++ trunk/libs/type_traits/doc/has_logical_and.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_logical_and.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_logical_and.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -70,6 +70,40 @@
boost::has_logical_and<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator&&` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_logical_and.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator&&(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_logical_and< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g&&g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_logical_and< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b&&b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_logical_not.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_logical_not.qbk (original)
+++ trunk/libs/type_traits/doc/has_logical_not.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -25,7 +25,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_logical_not.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_logical_not.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -70,6 +70,40 @@
boost::has_logical_not<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator!` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_logical_not.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator!(const contains<T> &rhs) {
+ return f(rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_logical_not< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ !g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_logical_not< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ !b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_logical_or.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_logical_or.qbk (original)
+++ trunk/libs/type_traits/doc/has_logical_or.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_logical_or.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_logical_or.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -70,6 +70,40 @@
boost::has_logical_or<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator||` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_logical_or.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator||(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_logical_or< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g||g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_logical_or< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b||b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_minus.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_minus.qbk (original)
+++ trunk/libs/type_traits/doc/has_minus.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_minus.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_minus.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_minus<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator-` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_minus.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator-(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_minus< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g-g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_minus< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b-b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_minus_assign.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_minus_assign.qbk (original)
+++ trunk/libs/type_traits/doc/has_minus_assign.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_minus_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_minus_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_minus_assign<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator-=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_minus_assign.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator-=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_minus_assign< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g-=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_minus_assign< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b-=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_modulus.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_modulus.qbk (original)
+++ trunk/libs/type_traits/doc/has_modulus.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_modulus.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_modulus.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -69,6 +69,40 @@
boost::has_modulus<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator%` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_modulus.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator%(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_modulus< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g%g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_modulus< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b%b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_modulus_assign.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_modulus_assign.qbk (original)
+++ trunk/libs/type_traits/doc/has_modulus_assign.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_modulus_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_modulus_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -69,6 +69,40 @@
boost::has_modulus_assign<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator%=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_modulus_assign.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator%=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_modulus_assign< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g%=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_modulus_assign< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b%=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_multiplies.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_multiplies.qbk (original)
+++ trunk/libs/type_traits/doc/has_multiplies.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_multiplies.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_multiplies.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_multiplies<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator*` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_multiplies.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator*(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_multiplies< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g*g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_multiplies< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b*b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_multiplies_assign.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_multiplies_assign.qbk (original)
+++ trunk/libs/type_traits/doc/has_multiplies_assign.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_multiplies_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_multiplies_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_multiplies_assign<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator*=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_multiplies_assign.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator*=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_multiplies_assign< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g*=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_multiplies_assign< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b*=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_negate.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_negate.qbk (original)
+++ trunk/libs/type_traits/doc/has_negate.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -25,7 +25,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_negate.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_negate.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -70,6 +70,40 @@
boost::has_negate<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator-` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_negate.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator-(const contains<T> &rhs) {
+ return f(rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_negate< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ -g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_negate< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ -b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_not_equal_to.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_not_equal_to.qbk (original)
+++ trunk/libs/type_traits/doc/has_not_equal_to.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_not_equal_to.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_not_equal_to.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_not_equal_to<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator!=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_not_equal_to.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator!=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_not_equal_to< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g!=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_not_equal_to< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b!=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_plus.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_plus.qbk (original)
+++ trunk/libs/type_traits/doc/has_plus.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_plus.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_plus.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_plus<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator+` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_plus.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator+(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_plus< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g+g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_plus< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b+b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_plus_assign.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_plus_assign.qbk (original)
+++ trunk/libs/type_traits/doc/has_plus_assign.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_plus_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_plus_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -71,6 +71,40 @@
boost::has_plus_assign<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator+=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_plus_assign.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator+=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_plus_assign< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g+=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_plus_assign< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b+=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_post_decrement.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_post_decrement.qbk (original)
+++ trunk/libs/type_traits/doc/has_post_decrement.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -25,7 +25,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_post_decrement.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_post_decrement.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -72,6 +72,40 @@
boost::has_post_decrement<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator--` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_post_decrement.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator--(const contains<T> &lhs, int) {
+ return f(lhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_post_decrement< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g--; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_post_decrement< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b--; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_post_increment.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_post_increment.qbk (original)
+++ trunk/libs/type_traits/doc/has_post_increment.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -25,7 +25,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_post_increment.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_post_increment.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -72,6 +72,40 @@
boost::has_post_increment<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator++` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_post_increment.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator++(const contains<T> &lhs, int) {
+ return f(lhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_post_increment< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g++; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_post_increment< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b++; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_pre_decrement.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_pre_decrement.qbk (original)
+++ trunk/libs/type_traits/doc/has_pre_decrement.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -25,7 +25,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_pre_decrement.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_pre_decrement.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -72,6 +72,40 @@
boost::has_pre_decrement<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator--` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_pre_decrement.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator--(const contains<T> &rhs) {
+ return f(rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_pre_decrement< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ --g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_pre_decrement< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ --b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_pre_increment.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_pre_increment.qbk (original)
+++ trunk/libs/type_traits/doc/has_pre_increment.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -25,7 +25,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_pre_increment.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_pre_increment.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -72,6 +72,40 @@
boost::has_pre_increment<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator++` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_pre_increment.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator++(const contains<T> &rhs) {
+ return f(rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_pre_increment< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ ++g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_pre_increment< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ ++b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_right_shift.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_right_shift.qbk (original)
+++ trunk/libs/type_traits/doc/has_right_shift.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_right_shift.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_right_shift.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -72,6 +72,40 @@
boost::has_right_shift<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator>>` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_right_shift.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator>>(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_right_shift< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g>>g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_right_shift< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b>>b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_right_shift_assign.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_right_shift_assign.qbk (original)
+++ trunk/libs/type_traits/doc/has_right_shift_assign.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -26,7 +26,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_right_shift_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_right_shift_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -69,6 +69,40 @@
boost::has_right_shift_assign<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator>>=` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_right_shift_assign.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator>>=(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_right_shift_assign< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g>>=g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_right_shift_assign< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b>>=b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_unary_minus.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_unary_minus.qbk (original)
+++ trunk/libs/type_traits/doc/has_unary_minus.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -25,7 +25,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_unary_minus.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_unary_minus.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -70,6 +70,40 @@
boost::has_unary_minus<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator-` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_unary_minus.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator-(const contains<T> &rhs) {
+ return f(rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_unary_minus< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ -g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_unary_minus< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ -b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/has_unary_plus.qbk
==============================================================================
--- trunk/libs/type_traits/doc/has_unary_plus.qbk (original)
+++ trunk/libs/type_traits/doc/has_unary_plus.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -25,7 +25,7 @@
``
If `Ret=void`, the return type is checked to be exactly `void`.
-__header `#include <boost/type_traits/has_unary_plus.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
+__header `#include <boost/type_traits/has_unary_plus.hpp>` or `#include <boost/type_traits/has_operator.hpp>` or `#include <boost/type_traits.hpp>`
__examples
@@ -70,6 +70,40 @@
boost::has_unary_plus<B>::value; // error: ambiguous overload
``
+* There is an issue when applying this trait to template classes.
+If `operator+` is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+Example:
+``
+#include <boost/type_traits/has_unary_plus.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator+(const contains<T> &rhs) {
+ return f(rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_unary_plus< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ +g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_unary_plus< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ +b; // compile time error
+ return 0;
+}
+``
+
* `volatile` qualifier is not properly handled and would lead to undefined behavior
[endsect]
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -1334,58 +1334,85 @@
<a class="link" href="operators.html#boost_typetraits.category.value_traits.operators.known_issues">Known
issues</a>
</h6>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
These traits cannot detect whether the operators are public or not:
if an operator is defined as a private member of type <code class="computeroutput"><span class="identifier">T</span></code> then the instantiation of the corresponding
trait will produce a compiler error. For this reason these traits cannot
- be used to determine whether a type has a public operator or not.
- </li></ul></div>
-<p>
-
-</p>
+ be used to determine whether a type has a public operator or not.
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="identifier">A</span> <span class="keyword">operator</span><span class="special">-();</span> <span class="special">};</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_unary_minus</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator-() is private</span>
</pre>
-<p>
- </p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ </li>
+<li class="listitem">
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
In this case, the compiler will report an ambiguous overload because
both the existing operator and the one we provide (with argument of
type <code class="computeroutput"><span class="identifier">any</span></code>) need type
- conversion, so that none is preferred.
- </li></ul></div>
-<p>
-
-</p>
+ conversion, so that none is preferred.
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_unary_minus</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_unary_minus</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload between</span>
- <span class="comment">// operator-(const any&) and</span>
- <span class="comment">// operator-(const A&)</span>
- <span class="comment">// both need type conversion</span>
+ <span class="comment">// operator-(const any&) and</span>
+ <span class="comment">// operator-(const A&)</span>
+ <span class="comment">// both need type conversion</span>
</pre>
-<p>
-
-</p>
+
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="special">};</span>
<span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="identifier">A</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">B</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span> <span class="special">};</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_unary_minus</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_unary_minus</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload between</span>
- <span class="comment">// operator-(const any&) and</span>
- <span class="comment">// operator-(const A&)</span>
- <span class="comment">// both need type conversion</span>
+ <span class="comment">// operator-(const any&) and</span>
+ <span class="comment">// operator-(const A&)</span>
+ <span class="comment">// both need type conversion</span>
</pre>
-<p>
- </p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ </li>
+<li class="listitem">
+ There is an issue when applying these traits to template classes. If
+ the operator is defined but does not bind for a given template type,
+ it is still detected by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. This
+ applies in particular to the containers of the standard library and
+ <code class="computeroutput"><span class="keyword">operator</span><span class="special">==</span></code>.
+ Example:
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_equal_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_equal_to</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">==</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_equal_to</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">==</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is
not properly handled and would lead to undefined behavior
- </li></ul></div>
+ </li>
+</ul></div>
<a name="boost_typetraits.category.value_traits.operators.acknowledgments"></a><h6>
<a name="boost_typetraits.category.value_traits.operators.acknowledgments-heading"></a>
<a class="link" href="operators.html#boost_typetraits.category.value_traits.operators.acknowledgments">Acknowledgments</a>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_and</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -131,6 +132,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">&</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_and</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">&(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_and</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">&</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_and</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">&</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_and_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -131,6 +132,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">&=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_and_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">&=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_and_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">&=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_and_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">&=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_or</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -129,6 +130,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">|</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_or</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">|(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_or</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">|</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_or</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">|</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_or_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -131,6 +132,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">|=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_or_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">|=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_or_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">|=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_or_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">|=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_xor</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -129,6 +130,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">^</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_xor</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">^(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_xor</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">^</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_xor</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">^</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_xor_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -131,6 +132,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">^=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_xor_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">^=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_xor_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">^=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_xor_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">^=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_complement</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -138,6 +139,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">~</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_complement</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">~(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_complement</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="special">~</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_complement</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="special">~</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_dereference</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -147,6 +148,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">*</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_dereference</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_dereference</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="special">*</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_dereference</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="special">*</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_divides</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -135,6 +136,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">/</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_divides</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_divides</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">/</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_divides</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">/</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_divides_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -137,6 +138,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">/=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_divides_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_divides_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">/=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_divides_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">/=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_equal_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -136,6 +137,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">==</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_equal_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_equal_to</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">==</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_equal_to</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">==</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_greater</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -136,6 +137,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">></span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_greater</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_greater</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">></span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_greater</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">></span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_greater_equal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -136,6 +137,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_greater_equal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_greater_equal</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">>=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_greater_equal</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">>=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_left_shift</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -143,6 +144,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_left_shift</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><<(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_left_shift</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special"><<</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_left_shift</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special"><<</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_left_shift_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -131,6 +132,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_left_shift_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><<=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_left_shift_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special"><<=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_left_shift_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special"><<=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_less</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -136,6 +137,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special"><</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_less</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_less</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special"><</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_less</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special"><</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_less_equal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -136,6 +137,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_less_equal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_less_equal</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special"><=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_less_equal</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special"><=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_logical_and</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -134,6 +135,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">&&</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_logical_and</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">&&(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_and</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">&&</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_and</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">&&</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_logical_not</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -134,6 +135,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">!</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_logical_not</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_not</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="special">!</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_not</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="special">!</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_logical_or</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -134,6 +135,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">||</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_logical_or</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">||(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_or</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">||</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_or</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">||</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_minus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -135,6 +136,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_minus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_minus</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">-</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_minus</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">-</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_minus_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -137,6 +138,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_minus_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_minus_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">-=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_minus_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">-=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_modulus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -128,6 +129,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_modulus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">%(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_modulus</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">%</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_modulus</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">%</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_modulus_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -130,6 +131,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_modulus_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_modulus_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">%=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_modulus_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">%=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_multiplies</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -135,6 +136,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">*</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_multiplies</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_multiplies</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">*</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_multiplies</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">*</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_multiplies_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -137,6 +138,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">*=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_multiplies_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_multiplies_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">*=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_multiplies_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">*=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_negate</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -134,6 +135,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_negate</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_negate</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="special">-</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_negate</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="special">-</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_not_equal_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -136,6 +137,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_not_equal_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_not_equal_to</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">!=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_not_equal_to</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">!=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_plus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -135,6 +136,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">+</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_plus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_plus</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">+</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_plus</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">+</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_plus_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -137,6 +138,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">+=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_plus_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_plus_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">+=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_plus_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">+=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_post_decrement</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -144,6 +145,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">--</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_post_decrement</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">--(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">int</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_post_decrement</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">--;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_post_decrement</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">--;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_post_increment</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -144,6 +145,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">++</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_post_increment</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">++(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">int</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_post_increment</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">++;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_post_increment</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">++;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_pre_decrement</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -144,6 +145,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">--</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_pre_decrement</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">--(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_pre_decrement</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="special">--</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_pre_decrement</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="special">--</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_pre_increment</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -144,6 +145,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">++</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_pre_increment</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">++(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_pre_increment</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="special">++</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_pre_increment</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="special">++</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_right_shift</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -143,6 +144,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">>></span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_right_shift</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>>(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_right_shift</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">>></span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_right_shift</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">>></span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_right_shift_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -135,6 +136,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">>>=</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_right_shift_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>>=(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_right_shift_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="identifier">g</span><span class="special">>>=</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_right_shift_assign</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="identifier">b</span><span class="special">>>=</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_unary_minus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -134,6 +135,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_unary_minus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_unary_minus</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="special">-</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_unary_minus</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="special">-</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html
==============================================================================
--- trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html (original)
+++ trunk/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -60,6 +60,7 @@
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_unary_plus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
@@ -134,6 +135,41 @@
</pre>
</li>
<li class="listitem">
+ There is an issue when applying this trait to template classes. If <code class="computeroutput"><span class="keyword">operator</span><span class="special">+</span></code>
+ is defined but does not bind for a given template type, it is still detected
+ by the trait which returns <code class="computeroutput"><span class="keyword">true</span></code>
+ instead of <code class="computeroutput"><span class="keyword">false</span></code>. Example:
+
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_unary_plus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">contains</span> <span class="special">{</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">;</span> <span class="special">};</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">contains</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span><span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">.</span><span class="identifier">data</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
+<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
+ <span class="comment">// works fine for contains<good></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_unary_plus</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">good</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">good</span><span class="special">></span> <span class="identifier">g</span><span class="special">;</span>
+ <span class="special">+</span><span class="identifier">g</span><span class="special">;</span> <span class="comment">// ok</span>
+ <span class="comment">// does not work for contains<bad></span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_unary_plus</span><span class="special"><</span> <span class="identifier">contains</span><span class="special"><</span> <span class="identifier">bad</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">value</span><span class="special"><<</span><span class="char">'\n'</span><span class="special">;</span> <span class="comment">// true, should be false</span>
+ <span class="identifier">contains</span><span class="special"><</span><span class="identifier">bad</span><span class="special">></span> <span class="identifier">b</span><span class="special">;</span>
+ <span class="special">+</span><span class="identifier">b</span><span class="special">;</span> <span class="comment">// compile time error</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+ </li>
+<li class="listitem">
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
properly handled and would lead to undefined behavior
</li>
Modified: trunk/libs/type_traits/doc/html/index.html
==============================================================================
--- trunk/libs/type_traits/doc/html/index.html (original)
+++ trunk/libs/type_traits/doc/html/index.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -31,7 +31,7 @@
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
Watanabe</p></div>
<div><div class="legalnotice">
-<a name="id3043727"></a><p>
+<a name="id3246830"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
Modified: trunk/libs/type_traits/doc/html/index/s11.html
==============================================================================
--- trunk/libs/type_traits/doc/html/index/s11.html (original)
+++ trunk/libs/type_traits/doc/html/index/s11.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -24,7 +24,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id3187570"></a>Class Index</h2></div></div></div>
+<a name="id3424769"></a>Class Index</h2></div></div></div>
<p><a class="link" href="s11.html#idx_id_0">A</a> <a class="link" href="s11.html#idx_id_2">C</a> <a class="link" href="s11.html#idx_id_3">D</a> <a class="link" href="s11.html#idx_id_4">E</a> <a class="link" href="s11.html#idx_id_5">F</a> <a class="link" href="s11.html#idx_id_6">H</a> <a class="link" href="s11.html#idx_id_7">I</a> <a class="link" href="s11.html#idx_id_8">M</a> <a class="link" href="s11.html#idx_id_9">N</a> <a class="link" href="s11.html#idx_id_10">O</a> <a class="link" href="s11.html#idx_id_11">P</a> <a class="link" href="s11.html#idx_id_12">R</a> <a class="link" href="s11.html#idx_id_13">T</a></p>
<div class="variablelist"><dl>
<dt>
@@ -130,7 +130,13 @@
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_dereference.html" title="has_dereference"><span class="index-entry-level-0">has_dereference</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_divides.html" title="has_divides"><span class="index-entry-level-0">has_divides</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_divides_assign.html" title="has_divides_assign"><span class="index-entry-level-0">has_divides_assign</span></a></p></li>
-<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_equal_to.html" title="has_equal_to"><span class="index-entry-level-0">has_equal_to</span></a></p></li>
+<li class="listitem" style="list-style-type: none">
+<p><span class="index-entry-level-0">has_equal_to</span></p>
+<div class="index"><ul class="index" type="none" compact>
+<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_equal_to.html" title="has_equal_to"><span class="index-entry-level-1">has_equal_to</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Operator Type Traits</span></a></p></li>
+</ul></div>
+</li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_greater.html" title="has_greater"><span class="index-entry-level-0">has_greater</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_greater_equal.html" title="has_greater_equal"><span class="index-entry-level-0">has_greater_equal</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_left_shift.html" title="has_left_shift"><span class="index-entry-level-0">has_left_shift</span></a></p></li>
@@ -337,6 +343,50 @@
</dt>
<dd><div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none">
+<p><span class="index-entry-level-0">trait</span></p>
+<div class="index"><ul class="index" type="none" compact>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_and.html" title="has_bit_and"><span class="index-entry-level-1">has_bit_and</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_and_assign.html" title="has_bit_and_assign"><span class="index-entry-level-1">has_bit_and_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_or.html" title="has_bit_or"><span class="index-entry-level-1">has_bit_or</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_or_assign.html" title="has_bit_or_assign"><span class="index-entry-level-1">has_bit_or_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_xor.html" title="has_bit_xor"><span class="index-entry-level-1">has_bit_xor</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_xor_assign.html" title="has_bit_xor_assign"><span class="index-entry-level-1">has_bit_xor_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_complement.html" title="has_complement"><span class="index-entry-level-1">has_complement</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_dereference.html" title="has_dereference"><span class="index-entry-level-1">has_dereference</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_divides.html" title="has_divides"><span class="index-entry-level-1">has_divides</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_divides_assign.html" title="has_divides_assign"><span class="index-entry-level-1">has_divides_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_equal_to.html" title="has_equal_to"><span class="index-entry-level-1">has_equal_to</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_greater.html" title="has_greater"><span class="index-entry-level-1">has_greater</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_greater_equal.html" title="has_greater_equal"><span class="index-entry-level-1">has_greater_equal</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_left_shift.html" title="has_left_shift"><span class="index-entry-level-1">has_left_shift</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_left_shift_assign.html" title="has_left_shift_assign"><span class="index-entry-level-1">has_left_shift_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_less.html" title="has_less"><span class="index-entry-level-1">has_less</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_less_equal.html" title="has_less_equal"><span class="index-entry-level-1">has_less_equal</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_and.html" title="has_logical_and"><span class="index-entry-level-1">has_logical_and</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_not.html" title="has_logical_not"><span class="index-entry-level-1">has_logical_not</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_or.html" title="has_logical_or"><span class="index-entry-level-1">has_logical_or</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_minus.html" title="has_minus"><span class="index-entry-level-1">has_minus</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_minus_assign.html" title="has_minus_assign"><span class="index-entry-level-1">has_minus_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_modulus.html" title="has_modulus"><span class="index-entry-level-1">has_modulus</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_modulus_assign.html" title="has_modulus_assign"><span class="index-entry-level-1">has_modulus_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_multiplies.html" title="has_multiplies"><span class="index-entry-level-1">has_multiplies</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_multiplies_assign.html" title="has_multiplies_assign"><span class="index-entry-level-1">has_multiplies_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_negate.html" title="has_negate"><span class="index-entry-level-1">has_negate</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_not_equal_to.html" title="has_not_equal_to"><span class="index-entry-level-1">has_not_equal_to</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_plus.html" title="has_plus"><span class="index-entry-level-1">has_plus</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_plus_assign.html" title="has_plus_assign"><span class="index-entry-level-1">has_plus_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_post_decrement.html" title="has_post_decrement"><span class="index-entry-level-1">has_post_decrement</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_post_increment.html" title="has_post_increment"><span class="index-entry-level-1">has_post_increment</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_pre_decrement.html" title="has_pre_decrement"><span class="index-entry-level-1">has_pre_decrement</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_pre_increment.html" title="has_pre_increment"><span class="index-entry-level-1">has_pre_increment</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_right_shift.html" title="has_right_shift"><span class="index-entry-level-1">has_right_shift</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_right_shift_assign.html" title="has_right_shift_assign"><span class="index-entry-level-1">has_right_shift_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_unary_minus.html" title="has_unary_minus"><span class="index-entry-level-1">has_unary_minus</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_unary_plus.html" title="has_unary_plus"><span class="index-entry-level-1">has_unary_plus</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Operator Type Traits</span></a></p></li>
+</ul></div>
+</li>
+<li class="listitem" style="list-style-type: none">
<p><span class="index-entry-level-0">trait_impl</span></p>
<div class="index"><ul class="index" type="none" compact><li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Operator Type Traits</span></a></p></li></ul></div>
</li>
Modified: trunk/libs/type_traits/doc/html/index/s12.html
==============================================================================
--- trunk/libs/type_traits/doc/html/index/s12.html (original)
+++ trunk/libs/type_traits/doc/html/index/s12.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -24,7 +24,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id3190401"></a>Typedef Index</h2></div></div></div>
+<a name="id3428131"></a>Typedef Index</h2></div></div></div>
<p><a class="link" href="s12.html#idx_id_20">F</a> <a class="link" href="s12.html#idx_id_27">R</a> <a class="link" href="s12.html#idx_id_28">T</a></p>
<div class="variablelist"><dl>
<dt>
Modified: trunk/libs/type_traits/doc/html/index/s13.html
==============================================================================
--- trunk/libs/type_traits/doc/html/index/s13.html (original)
+++ trunk/libs/type_traits/doc/html/index/s13.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -24,7 +24,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id3190640"></a>Macro Index</h2></div></div></div>
+<a name="id3428370"></a>Macro Index</h2></div></div></div>
<p><a class="link" href="s13.html#idx_id_31">B</a></p>
<div class="variablelist"><dl>
<dt>
Modified: trunk/libs/type_traits/doc/html/index/s14.html
==============================================================================
--- trunk/libs/type_traits/doc/html/index/s14.html (original)
+++ trunk/libs/type_traits/doc/html/index/s14.html 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -23,7 +23,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id3191368"></a>Index</h2></div></div></div>
+<a name="id3429100"></a>Index</h2></div></div></div>
<p><a class="link" href="s14.html#idx_id_45">A</a> <a class="link" href="s14.html#idx_id_46">B</a> <a class="link" href="s14.html#idx_id_47">C</a> <a class="link" href="s14.html#idx_id_48">D</a> <a class="link" href="s14.html#idx_id_49">E</a> <a class="link" href="s14.html#idx_id_50">F</a> <a class="link" href="s14.html#idx_id_51">H</a> <a class="link" href="s14.html#idx_id_52">I</a> <a class="link" href="s14.html#idx_id_53">M</a> <a class="link" href="s14.html#idx_id_54">N</a> <a class="link" href="s14.html#idx_id_55">O</a> <a class="link" href="s14.html#idx_id_56">P</a> <a class="link" href="s14.html#idx_id_57">R</a> <a class="link" href="s14.html#idx_id_58">T</a> <a class="link" href="s14.html#idx_id_59">U</a></p>
<div class="variablelist"><dl>
<dt>
@@ -279,6 +279,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_and.html" title="has_bit_and"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_bit_and.html" title="has_bit_and"><span class="index-entry-level-1">has_bit_and</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_and.html" title="has_bit_and"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -286,6 +287,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_and_assign.html" title="has_bit_and_assign"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_bit_and_assign.html" title="has_bit_and_assign"><span class="index-entry-level-1">has_bit_and_assign</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_and_assign.html" title="has_bit_and_assign"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -293,6 +295,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_or.html" title="has_bit_or"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_bit_or.html" title="has_bit_or"><span class="index-entry-level-1">has_bit_or</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_or.html" title="has_bit_or"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -300,6 +303,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_or_assign.html" title="has_bit_or_assign"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_bit_or_assign.html" title="has_bit_or_assign"><span class="index-entry-level-1">has_bit_or_assign</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_or_assign.html" title="has_bit_or_assign"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -307,6 +311,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_xor.html" title="has_bit_xor"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_bit_xor.html" title="has_bit_xor"><span class="index-entry-level-1">has_bit_xor</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_xor.html" title="has_bit_xor"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -314,6 +319,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_xor_assign.html" title="has_bit_xor_assign"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_bit_xor_assign.html" title="has_bit_xor_assign"><span class="index-entry-level-1">has_bit_xor_assign</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_xor_assign.html" title="has_bit_xor_assign"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -321,6 +327,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_complement.html" title="has_complement"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_complement.html" title="has_complement"><span class="index-entry-level-1">has_complement</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_complement.html" title="has_complement"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -328,6 +335,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_dereference.html" title="has_dereference"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_dereference.html" title="has_dereference"><span class="index-entry-level-1">has_dereference</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_dereference.html" title="has_dereference"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -335,6 +343,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_divides.html" title="has_divides"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_divides.html" title="has_divides"><span class="index-entry-level-1">has_divides</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_divides.html" title="has_divides"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -342,6 +351,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_divides_assign.html" title="has_divides_assign"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_divides_assign.html" title="has_divides_assign"><span class="index-entry-level-1">has_divides_assign</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_divides_assign.html" title="has_divides_assign"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -349,6 +359,8 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_equal_to.html" title="has_equal_to"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_equal_to.html" title="has_equal_to"><span class="index-entry-level-1">has_equal_to</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Operator Type Traits</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_equal_to.html" title="has_equal_to"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -356,6 +368,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_greater.html" title="has_greater"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_greater.html" title="has_greater"><span class="index-entry-level-1">has_greater</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_greater.html" title="has_greater"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -363,6 +376,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_greater_equal.html" title="has_greater_equal"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_greater_equal.html" title="has_greater_equal"><span class="index-entry-level-1">has_greater_equal</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_greater_equal.html" title="has_greater_equal"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -370,6 +384,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_left_shift.html" title="has_left_shift"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_left_shift.html" title="has_left_shift"><span class="index-entry-level-1">has_left_shift</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_left_shift.html" title="has_left_shift"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -377,6 +392,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_left_shift_assign.html" title="has_left_shift_assign"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_left_shift_assign.html" title="has_left_shift_assign"><span class="index-entry-level-1">has_left_shift_assign</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_left_shift_assign.html" title="has_left_shift_assign"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -384,6 +400,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_less.html" title="has_less"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_less.html" title="has_less"><span class="index-entry-level-1">has_less</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_less.html" title="has_less"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -391,6 +408,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_less_equal.html" title="has_less_equal"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_less_equal.html" title="has_less_equal"><span class="index-entry-level-1">has_less_equal</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_less_equal.html" title="has_less_equal"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -398,6 +416,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_and.html" title="has_logical_and"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_logical_and.html" title="has_logical_and"><span class="index-entry-level-1">has_logical_and</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_and.html" title="has_logical_and"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -405,6 +424,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_not.html" title="has_logical_not"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_logical_not.html" title="has_logical_not"><span class="index-entry-level-1">has_logical_not</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_not.html" title="has_logical_not"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -412,6 +432,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_or.html" title="has_logical_or"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_logical_or.html" title="has_logical_or"><span class="index-entry-level-1">has_logical_or</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_or.html" title="has_logical_or"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -419,6 +440,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_minus.html" title="has_minus"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_minus.html" title="has_minus"><span class="index-entry-level-1">has_minus</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_minus.html" title="has_minus"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -426,6 +448,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_minus_assign.html" title="has_minus_assign"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_minus_assign.html" title="has_minus_assign"><span class="index-entry-level-1">has_minus_assign</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_minus_assign.html" title="has_minus_assign"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -433,6 +456,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_modulus.html" title="has_modulus"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_modulus.html" title="has_modulus"><span class="index-entry-level-1">has_modulus</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_modulus.html" title="has_modulus"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -440,6 +464,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_modulus_assign.html" title="has_modulus_assign"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_modulus_assign.html" title="has_modulus_assign"><span class="index-entry-level-1">has_modulus_assign</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_modulus_assign.html" title="has_modulus_assign"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -447,6 +472,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_multiplies.html" title="has_multiplies"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_multiplies.html" title="has_multiplies"><span class="index-entry-level-1">has_multiplies</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_multiplies.html" title="has_multiplies"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -454,6 +480,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_multiplies_assign.html" title="has_multiplies_assign"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_multiplies_assign.html" title="has_multiplies_assign"><span class="index-entry-level-1">has_multiplies_assign</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_multiplies_assign.html" title="has_multiplies_assign"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -461,6 +488,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_negate.html" title="has_negate"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_negate.html" title="has_negate"><span class="index-entry-level-1">has_negate</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_negate.html" title="has_negate"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_new_operator.html" title="has_new_operator"><span class="index-entry-level-0">has_new_operator</span></a></p></li>
@@ -494,6 +522,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_not_equal_to.html" title="has_not_equal_to"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_not_equal_to.html" title="has_not_equal_to"><span class="index-entry-level-1">has_not_equal_to</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_not_equal_to.html" title="has_not_equal_to"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -505,6 +534,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_plus.html" title="has_plus"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_plus.html" title="has_plus"><span class="index-entry-level-1">has_plus</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_plus.html" title="has_plus"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -512,6 +542,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_plus_assign.html" title="has_plus_assign"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_plus_assign.html" title="has_plus_assign"><span class="index-entry-level-1">has_plus_assign</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_plus_assign.html" title="has_plus_assign"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -519,6 +550,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_post_decrement.html" title="has_post_decrement"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_post_decrement.html" title="has_post_decrement"><span class="index-entry-level-1">has_post_decrement</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_post_decrement.html" title="has_post_decrement"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -526,6 +558,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_post_increment.html" title="has_post_increment"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_post_increment.html" title="has_post_increment"><span class="index-entry-level-1">has_post_increment</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_post_increment.html" title="has_post_increment"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -533,6 +566,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_pre_decrement.html" title="has_pre_decrement"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_pre_decrement.html" title="has_pre_decrement"><span class="index-entry-level-1">has_pre_decrement</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_pre_decrement.html" title="has_pre_decrement"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -540,6 +574,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_pre_increment.html" title="has_pre_increment"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_pre_increment.html" title="has_pre_increment"><span class="index-entry-level-1">has_pre_increment</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_pre_increment.html" title="has_pre_increment"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -547,6 +582,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_right_shift.html" title="has_right_shift"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_right_shift.html" title="has_right_shift"><span class="index-entry-level-1">has_right_shift</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_right_shift.html" title="has_right_shift"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -554,6 +590,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_right_shift_assign.html" title="has_right_shift_assign"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_right_shift_assign.html" title="has_right_shift_assign"><span class="index-entry-level-1">has_right_shift_assign</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_right_shift_assign.html" title="has_right_shift_assign"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -600,6 +637,7 @@
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_unary_minus.html" title="has_unary_minus"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_unary_minus.html" title="has_unary_minus"><span class="index-entry-level-1">has_unary_minus</span></a></strong></span></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Operator Type Traits</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_unary_minus.html" title="has_unary_minus"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -607,6 +645,7 @@
<div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_unary_plus.html" title="has_unary_plus"><span class="index-entry-level-1">dont_care</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><span class="bold"><strong><a class="link" href="../boost_typetraits/reference/has_unary_plus.html" title="has_unary_plus"><span class="index-entry-level-1">has_unary_plus</span></a></strong></span></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_unary_plus.html" title="has_unary_plus"><span class="index-entry-level-1">trait</span></a></p></li>
</ul></div>
</li>
<li class="listitem" style="list-style-type: none">
@@ -773,6 +812,7 @@
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">any</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">check</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">dont_care</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">has_equal_to</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">has_operator</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">has_unary_minus</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">integral_constant</span></a></p></li>
@@ -786,6 +826,7 @@
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Rhs_nocv</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Rhs_noptr</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Rhs_noref</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">trait</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">trait_impl</span></a></p></li>
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">trait_impl1</span></a></p></li>
</ul></div>
@@ -861,6 +902,50 @@
</dt>
<dd><div class="index"><ul class="index" type="none" compact>
<li class="listitem" style="list-style-type: none">
+<p><span class="index-entry-level-0">trait</span></p>
+<div class="index"><ul class="index" type="none" compact>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_and.html" title="has_bit_and"><span class="index-entry-level-1">has_bit_and</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_and_assign.html" title="has_bit_and_assign"><span class="index-entry-level-1">has_bit_and_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_or.html" title="has_bit_or"><span class="index-entry-level-1">has_bit_or</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_or_assign.html" title="has_bit_or_assign"><span class="index-entry-level-1">has_bit_or_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_xor.html" title="has_bit_xor"><span class="index-entry-level-1">has_bit_xor</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_bit_xor_assign.html" title="has_bit_xor_assign"><span class="index-entry-level-1">has_bit_xor_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_complement.html" title="has_complement"><span class="index-entry-level-1">has_complement</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_dereference.html" title="has_dereference"><span class="index-entry-level-1">has_dereference</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_divides.html" title="has_divides"><span class="index-entry-level-1">has_divides</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_divides_assign.html" title="has_divides_assign"><span class="index-entry-level-1">has_divides_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_equal_to.html" title="has_equal_to"><span class="index-entry-level-1">has_equal_to</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_greater.html" title="has_greater"><span class="index-entry-level-1">has_greater</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_greater_equal.html" title="has_greater_equal"><span class="index-entry-level-1">has_greater_equal</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_left_shift.html" title="has_left_shift"><span class="index-entry-level-1">has_left_shift</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_left_shift_assign.html" title="has_left_shift_assign"><span class="index-entry-level-1">has_left_shift_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_less.html" title="has_less"><span class="index-entry-level-1">has_less</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_less_equal.html" title="has_less_equal"><span class="index-entry-level-1">has_less_equal</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_and.html" title="has_logical_and"><span class="index-entry-level-1">has_logical_and</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_not.html" title="has_logical_not"><span class="index-entry-level-1">has_logical_not</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_logical_or.html" title="has_logical_or"><span class="index-entry-level-1">has_logical_or</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_minus.html" title="has_minus"><span class="index-entry-level-1">has_minus</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_minus_assign.html" title="has_minus_assign"><span class="index-entry-level-1">has_minus_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_modulus.html" title="has_modulus"><span class="index-entry-level-1">has_modulus</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_modulus_assign.html" title="has_modulus_assign"><span class="index-entry-level-1">has_modulus_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_multiplies.html" title="has_multiplies"><span class="index-entry-level-1">has_multiplies</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_multiplies_assign.html" title="has_multiplies_assign"><span class="index-entry-level-1">has_multiplies_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_negate.html" title="has_negate"><span class="index-entry-level-1">has_negate</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_not_equal_to.html" title="has_not_equal_to"><span class="index-entry-level-1">has_not_equal_to</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_plus.html" title="has_plus"><span class="index-entry-level-1">has_plus</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_plus_assign.html" title="has_plus_assign"><span class="index-entry-level-1">has_plus_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_post_decrement.html" title="has_post_decrement"><span class="index-entry-level-1">has_post_decrement</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_post_increment.html" title="has_post_increment"><span class="index-entry-level-1">has_post_increment</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_pre_decrement.html" title="has_pre_decrement"><span class="index-entry-level-1">has_pre_decrement</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_pre_increment.html" title="has_pre_increment"><span class="index-entry-level-1">has_pre_increment</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_right_shift.html" title="has_right_shift"><span class="index-entry-level-1">has_right_shift</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_right_shift_assign.html" title="has_right_shift_assign"><span class="index-entry-level-1">has_right_shift_assign</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_unary_minus.html" title="has_unary_minus"><span class="index-entry-level-1">has_unary_minus</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/has_unary_plus.html" title="has_unary_plus"><span class="index-entry-level-1">has_unary_plus</span></a></p></li>
+<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Operator Type Traits</span></a></p></li>
+</ul></div>
+</li>
+<li class="listitem" style="list-style-type: none">
<p><span class="index-entry-level-0">trait_impl</span></p>
<div class="index"><ul class="index" type="none" compact><li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Operator Type Traits</span></a></p></li></ul></div>
</li>
Modified: trunk/libs/type_traits/doc/operators.qbk
==============================================================================
--- trunk/libs/type_traits/doc/operators.qbk (original)
+++ trunk/libs/type_traits/doc/operators.qbk 2011-10-21 19:42:44 EDT (Fri, 21 Oct 2011)
@@ -425,7 +425,6 @@
the instantiation of the corresponding trait will produce a compiler error.
For this reason these traits cannot be used to determine whether a type has a
public operator or not.
-
``
struct A { private: A operator-(); };
boost::has_unary_minus<A>::value; // error: A::operator-() is private
@@ -435,16 +434,15 @@
convertible to `A`. In this case, the compiler will report an ambiguous overload
because both the existing operator and the one we provide (with argument of type
`any`) need type conversion, so that none is preferred.
-
``
struct A { };
void operator-(const A&);
struct B { operator A(); };
boost::has_unary_minus<A>::value; // this is fine
boost::has_unary_minus<B>::value; // error: ambiguous overload between
- // operator-(const any&) and
- // operator-(const A&)
- // both need type conversion
+ // operator-(const any&) and
+ // operator-(const A&)
+ // both need type conversion
``
``
struct B { };
@@ -452,9 +450,44 @@
void operator-(const A&);
boost::has_unary_minus<A>::value; // this is fine
boost::has_unary_minus<B>::value; // error: ambiguous overload between
- // operator-(const any&) and
- // operator-(const A&)
- // both need type conversion
+ // operator-(const any&) and
+ // operator-(const A&)
+ // both need type conversion
+``
+
+* There is an issue when applying these traits to template classes.
+If the operator is defined but does not bind for a given template type,
+it is still detected by the trait which returns `true` instead of `false`.
+This applies in particular to the containers of the standard library and `operator==`.
+Example:
+``
+#include <boost/type_traits/has_equal_to.hpp>
+#include <iostream>
+
+template <class T>
+struct contains { T data; };
+
+template <class T>
+bool operator==(const contains<T> &lhs, const contains<T> &rhs) {
+ return f(lhs.data, rhs.data);
+}
+
+class bad { };
+class good { };
+bool f(const good&, const good&) { }
+
+int main() {
+ std::cout<<std::boolalpha;
+ // works fine for contains<good>
+ std::cout<<boost::has_equal_to< contains< good > >::value<<'\n'; // true
+ contains<good> g;
+ g==g; // ok
+ // does not work for contains<bad>
+ std::cout<<boost::has_equal_to< contains< bad > >::value<<'\n'; // true, should be false
+ contains<bad> b;
+ b==b; // compile time error
+ return 0;
+}
``
* `volatile` qualifier is not properly handled and would lead to undefined behavior
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