|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75085 - in branches/release: boost boost/type_traits libs/type_traits libs/type_traits/doc libs/type_traits/doc/html libs/type_traits/doc/html/boost_typetraits/category/value_traits libs/type_traits/doc/html/boost_typetraits/reference libs/type_traits/doc/html/index
From: frederic.bron_at_[hidden]
Date: 2011-10-21 20:23:18
Author: bronf
Date: 2011-10-21 20:23:10 EDT (Fri, 21 Oct 2011)
New Revision: 75085
URL: http://svn.boost.org/trac/boost/changeset/75085
Log:
operator type traits: merged trunk: documentation on the limitation to template classes
Properties modified:
branches/release/boost/type_traits/ (props changed)
branches/release/boost/type_traits.hpp (props changed)
branches/release/libs/type_traits/ (props changed)
Text files modified:
branches/release/libs/type_traits/doc/has_bit_and.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_bit_and_assign.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_bit_or.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_bit_or_assign.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_bit_xor.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_bit_xor_assign.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_complement.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_dereference.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_divides.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_divides_assign.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_equal_to.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_greater.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_greater_equal.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_left_shift.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_left_shift_assign.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_less.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_less_equal.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_logical_and.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_logical_not.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_logical_or.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_minus.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_minus_assign.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_modulus.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_modulus_assign.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_multiplies.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_multiplies_assign.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_negate.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_not_equal_to.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_plus.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_plus_assign.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_post_decrement.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_post_increment.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_pre_decrement.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_pre_increment.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_right_shift.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_right_shift_assign.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_unary_minus.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/has_unary_plus.qbk | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html | 81 ++++++++++++++++++++++++------------
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html | 36 ++++++++++++++++
branches/release/libs/type_traits/doc/html/index.html | 4
branches/release/libs/type_traits/doc/html/index/s11.html | 54 +++++++++++++++++++++++
branches/release/libs/type_traits/doc/html/index/s12.html | 2
branches/release/libs/type_traits/doc/html/index/s13.html | 2
branches/release/libs/type_traits/doc/html/index/s14.html | 87 +++++++++++++++++++++++++++++++++++++++
branches/release/libs/type_traits/doc/operators.qbk | 49 ++++++++++++++++++---
83 files changed, 2935 insertions(+), 80 deletions(-)
Modified: branches/release/libs/type_traits/doc/has_bit_and.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_bit_and.qbk (original)
+++ branches/release/libs/type_traits/doc/has_bit_and.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_bit_and_assign.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_bit_and_assign.qbk (original)
+++ branches/release/libs/type_traits/doc/has_bit_and_assign.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_bit_or.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_bit_or.qbk (original)
+++ branches/release/libs/type_traits/doc/has_bit_or.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_bit_or_assign.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_bit_or_assign.qbk (original)
+++ branches/release/libs/type_traits/doc/has_bit_or_assign.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_bit_xor.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_bit_xor.qbk (original)
+++ branches/release/libs/type_traits/doc/has_bit_xor.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_bit_xor_assign.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_bit_xor_assign.qbk (original)
+++ branches/release/libs/type_traits/doc/has_bit_xor_assign.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_complement.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_complement.qbk (original)
+++ branches/release/libs/type_traits/doc/has_complement.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_dereference.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_dereference.qbk (original)
+++ branches/release/libs/type_traits/doc/has_dereference.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_divides.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_divides.qbk (original)
+++ branches/release/libs/type_traits/doc/has_divides.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_divides_assign.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_divides_assign.qbk (original)
+++ branches/release/libs/type_traits/doc/has_divides_assign.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_equal_to.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_equal_to.qbk (original)
+++ branches/release/libs/type_traits/doc/has_equal_to.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_greater.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_greater.qbk (original)
+++ branches/release/libs/type_traits/doc/has_greater.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_greater_equal.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_greater_equal.qbk (original)
+++ branches/release/libs/type_traits/doc/has_greater_equal.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_left_shift.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_left_shift.qbk (original)
+++ branches/release/libs/type_traits/doc/has_left_shift.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_left_shift_assign.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_left_shift_assign.qbk (original)
+++ branches/release/libs/type_traits/doc/has_left_shift_assign.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_less.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_less.qbk (original)
+++ branches/release/libs/type_traits/doc/has_less.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_less_equal.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_less_equal.qbk (original)
+++ branches/release/libs/type_traits/doc/has_less_equal.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_logical_and.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_logical_and.qbk (original)
+++ branches/release/libs/type_traits/doc/has_logical_and.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_logical_not.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_logical_not.qbk (original)
+++ branches/release/libs/type_traits/doc/has_logical_not.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_logical_or.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_logical_or.qbk (original)
+++ branches/release/libs/type_traits/doc/has_logical_or.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_minus.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_minus.qbk (original)
+++ branches/release/libs/type_traits/doc/has_minus.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_minus_assign.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_minus_assign.qbk (original)
+++ branches/release/libs/type_traits/doc/has_minus_assign.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_modulus.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_modulus.qbk (original)
+++ branches/release/libs/type_traits/doc/has_modulus.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_modulus_assign.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_modulus_assign.qbk (original)
+++ branches/release/libs/type_traits/doc/has_modulus_assign.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_multiplies.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_multiplies.qbk (original)
+++ branches/release/libs/type_traits/doc/has_multiplies.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_multiplies_assign.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_multiplies_assign.qbk (original)
+++ branches/release/libs/type_traits/doc/has_multiplies_assign.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_negate.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_negate.qbk (original)
+++ branches/release/libs/type_traits/doc/has_negate.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_not_equal_to.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_not_equal_to.qbk (original)
+++ branches/release/libs/type_traits/doc/has_not_equal_to.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_plus.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_plus.qbk (original)
+++ branches/release/libs/type_traits/doc/has_plus.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_plus_assign.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_plus_assign.qbk (original)
+++ branches/release/libs/type_traits/doc/has_plus_assign.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_post_decrement.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_post_decrement.qbk (original)
+++ branches/release/libs/type_traits/doc/has_post_decrement.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_post_increment.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_post_increment.qbk (original)
+++ branches/release/libs/type_traits/doc/has_post_increment.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_pre_decrement.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_pre_decrement.qbk (original)
+++ branches/release/libs/type_traits/doc/has_pre_decrement.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_pre_increment.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_pre_increment.qbk (original)
+++ branches/release/libs/type_traits/doc/has_pre_increment.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_right_shift.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_right_shift.qbk (original)
+++ branches/release/libs/type_traits/doc/has_right_shift.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_right_shift_assign.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_right_shift_assign.qbk (original)
+++ branches/release/libs/type_traits/doc/has_right_shift_assign.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_unary_minus.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_unary_minus.qbk (original)
+++ branches/release/libs/type_traits/doc/has_unary_minus.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/has_unary_plus.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/has_unary_plus.qbk (original)
+++ branches/release/libs/type_traits/doc/has_unary_plus.qbk 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html 2011-10-21 20:23:10 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: branches/release/libs/type_traits/doc/html/index.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/index.html (original)
+++ branches/release/libs/type_traits/doc/html/index.html 2011-10-21 20:23:10 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="id3164235"></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>
@@ -212,7 +212,7 @@
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: October 07, 2011 at 23:05:54 +0200</small></p></td>
+<td align="left"><p><small>Last revised: October 10, 2011 at 00:28:33 +0200</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: branches/release/libs/type_traits/doc/html/index/s11.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/index/s11.html (original)
+++ branches/release/libs/type_traits/doc/html/index/s11.html 2011-10-21 20:23:10 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="id3342120"></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: branches/release/libs/type_traits/doc/html/index/s12.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/index/s12.html (original)
+++ branches/release/libs/type_traits/doc/html/index/s12.html 2011-10-21 20:23:10 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="id3345483"></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: branches/release/libs/type_traits/doc/html/index/s13.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/index/s13.html (original)
+++ branches/release/libs/type_traits/doc/html/index/s13.html 2011-10-21 20:23:10 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="id3345720"></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: branches/release/libs/type_traits/doc/html/index/s14.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/index/s14.html (original)
+++ branches/release/libs/type_traits/doc/html/index/s14.html 2011-10-21 20:23:10 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="id3346450"></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: branches/release/libs/type_traits/doc/operators.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/operators.qbk (original)
+++ branches/release/libs/type_traits/doc/operators.qbk 2011-10-21 20:23:10 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