diff --git a/doc/has_bit_and.qbk b/doc/has_bit_and.qbk index 1635fe2..4892125 100644 --- a/doc/has_bit_and.qbk +++ b/doc/has_bit_and.qbk @@ -26,7 +26,7 @@ f(lhs&rhs); // is valid if has_bit_and::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -69,6 +69,40 @@ boost::has_bit_and::value; // this is fine boost::has_bit_and::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 +#include + +template +struct contains { T data; }; + +template +bool operator&(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g&g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b&b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_bit_and_assign.qbk b/doc/has_bit_and_assign.qbk index 90d812e..382b345 100644 --- a/doc/has_bit_and_assign.qbk +++ b/doc/has_bit_and_assign.qbk @@ -26,7 +26,7 @@ f(lhs&=rhs); // is valid if has_bit_and_assign::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -69,6 +69,40 @@ boost::has_bit_and_assign::value; // this is fine boost::has_bit_and_assign::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 +#include + +template +struct contains { T data; }; + +template +bool operator&=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g&=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b&=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_bit_or.qbk b/doc/has_bit_or.qbk index 1ff6deb..30bdaf8 100644 --- a/doc/has_bit_or.qbk +++ b/doc/has_bit_or.qbk @@ -26,7 +26,7 @@ f(lhs|rhs); // is valid if has_bit_or::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -69,6 +69,40 @@ boost::has_bit_or::value; // this is fine boost::has_bit_or::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 +#include + +template +struct contains { T data; }; + +template +bool operator|(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g|g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b|b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_bit_or_assign.qbk b/doc/has_bit_or_assign.qbk index d434a77..7eb37f2 100644 --- a/doc/has_bit_or_assign.qbk +++ b/doc/has_bit_or_assign.qbk @@ -26,7 +26,7 @@ f(lhs|=rhs); // is valid if has_bit_or_assign::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -69,6 +69,40 @@ boost::has_bit_or_assign::value; // this is fine boost::has_bit_or_assign::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 +#include + +template +struct contains { T data; }; + +template +bool operator|=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g|=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b|=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_bit_xor.qbk b/doc/has_bit_xor.qbk index 40c2d05..874cf42 100644 --- a/doc/has_bit_xor.qbk +++ b/doc/has_bit_xor.qbk @@ -26,7 +26,7 @@ f(lhs^rhs); // is valid if has_bit_xor::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -69,6 +69,40 @@ boost::has_bit_xor::value; // this is fine boost::has_bit_xor::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 +#include + +template +struct contains { T data; }; + +template +bool operator^(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g^g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b^b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_bit_xor_assign.qbk b/doc/has_bit_xor_assign.qbk index 49b2ce8..4e503ba 100644 --- a/doc/has_bit_xor_assign.qbk +++ b/doc/has_bit_xor_assign.qbk @@ -26,7 +26,7 @@ f(lhs^=rhs); // is valid if has_bit_xor_assign::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -69,6 +69,40 @@ boost::has_bit_xor_assign::value; // this is fine boost::has_bit_xor_assign::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 +#include + +template +struct contains { T data; }; + +template +bool operator^=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g^=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b^=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_complement.qbk b/doc/has_complement.qbk index 3013668..c02760b 100644 --- a/doc/has_complement.qbk +++ b/doc/has_complement.qbk @@ -25,7 +25,7 @@ f(~rhs); // is valid if has_complement::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_complement::value; // this is fine boost::has_complement::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 +#include + +template +struct contains { T data; }; + +template +bool operator~(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + ~g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + ~b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_dereference.qbk b/doc/has_dereference.qbk index 3ce558d..5e729da 100644 --- a/doc/has_dereference.qbk +++ b/doc/has_dereference.qbk @@ -25,7 +25,7 @@ f(*rhs); // is valid if has_dereference::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -74,6 +74,40 @@ boost::has_dereference::value; // this is fine boost::has_dereference::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 +#include + +template +struct contains { T data; }; + +template +bool operator*(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + *g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + *b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_divides.qbk b/doc/has_divides.qbk index af60be6..8c614b0 100644 --- a/doc/has_divides.qbk +++ b/doc/has_divides.qbk @@ -26,7 +26,7 @@ f(lhs/rhs); // is valid if has_divides::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_divides::value; // this is fine boost::has_divides::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 +#include + +template +struct contains { T data; }; + +template +bool operator/(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g/g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b/b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_divides_assign.qbk b/doc/has_divides_assign.qbk index 2bec5da..393da41 100644 --- a/doc/has_divides_assign.qbk +++ b/doc/has_divides_assign.qbk @@ -26,7 +26,7 @@ f(lhs/=rhs); // is valid if has_divides_assign::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_divides_assign::value; // this is fine boost::has_divides_assign::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 +#include + +template +struct contains { T data; }; + +template +bool operator/=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g/=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b/=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_equal_to.qbk b/doc/has_equal_to.qbk index fbac606..78203d3 100644 --- a/doc/has_equal_to.qbk +++ b/doc/has_equal_to.qbk @@ -26,7 +26,7 @@ f(lhs==rhs); // is valid if has_equal_to::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_equal_to::value; // this is fine boost::has_equal_to::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 +#include + +template +struct contains { T data; }; + +template +bool operator==(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g==g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b==b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_greater.qbk b/doc/has_greater.qbk index c49b239..b9be45f 100644 --- a/doc/has_greater.qbk +++ b/doc/has_greater.qbk @@ -26,7 +26,7 @@ f(lhs>rhs); // is valid if has_greater::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_greater::value; // this is fine boost::has_greater::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 +#include + +template +struct contains { T data; }; + +template +bool operator>(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g>g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b>b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_greater_equal.qbk b/doc/has_greater_equal.qbk index 149d67c..9ea1cae 100644 --- a/doc/has_greater_equal.qbk +++ b/doc/has_greater_equal.qbk @@ -26,7 +26,7 @@ f(lhs>=rhs); // is valid if has_greater_equal::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_greater_equal::value; // this is fine boost::has_greater_equal::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 +#include + +template +struct contains { T data; }; + +template +bool operator>=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g>=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b>=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_left_shift.qbk b/doc/has_left_shift.qbk index a95f148..fa43945 100644 --- a/doc/has_left_shift.qbk +++ b/doc/has_left_shift.qbk @@ -26,7 +26,7 @@ f(lhs<::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -72,6 +72,40 @@ boost::has_left_shift::value; // this is fine boost::has_left_shift::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 +#include + +template +struct contains { T data; }; + +template +bool operator<<(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g< + std::cout< >::value<<'\n'; // true, should be false + contains b; + b<::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -69,6 +69,40 @@ boost::has_left_shift_assign::value; // this is fine boost::has_left_shift_assign::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 +#include + +template +struct contains { T data; }; + +template +bool operator<<=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g<<=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b<<=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_less.qbk b/doc/has_less.qbk index 5d1c19f..9dbf26d 100644 --- a/doc/has_less.qbk +++ b/doc/has_less.qbk @@ -26,7 +26,7 @@ f(lhs::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_less::value; // this is fine boost::has_less::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 +#include + +template +struct contains { T data; }; + +template +bool operator<(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g + std::cout< >::value<<'\n'; // true, should be false + contains b; + b::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_less_equal::value; // this is fine boost::has_less_equal::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 +#include + +template +struct contains { T data; }; + +template +bool operator<=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g<=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b<=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_logical_and.qbk b/doc/has_logical_and.qbk index d1dc6b2..1dfad18 100644 --- a/doc/has_logical_and.qbk +++ b/doc/has_logical_and.qbk @@ -26,7 +26,7 @@ f(lhs&&rhs); // is valid if has_logical_and::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -70,6 +70,40 @@ boost::has_logical_and::value; // this is fine boost::has_logical_and::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 +#include + +template +struct contains { T data; }; + +template +bool operator&&(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g&&g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b&&b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_logical_not.qbk b/doc/has_logical_not.qbk index c969f18..58fbf3a 100644 --- a/doc/has_logical_not.qbk +++ b/doc/has_logical_not.qbk @@ -25,7 +25,7 @@ f(!rhs); // is valid if has_logical_not::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -70,6 +70,40 @@ boost::has_logical_not::value; // this is fine boost::has_logical_not::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 +#include + +template +struct contains { T data; }; + +template +bool operator!(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + !g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + !b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_logical_or.qbk b/doc/has_logical_or.qbk index 67f6031..29affa6 100644 --- a/doc/has_logical_or.qbk +++ b/doc/has_logical_or.qbk @@ -26,7 +26,7 @@ f(lhs||rhs); // is valid if has_logical_or::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -70,6 +70,40 @@ boost::has_logical_or::value; // this is fine boost::has_logical_or::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 +#include + +template +struct contains { T data; }; + +template +bool operator||(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g||g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b||b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_minus.qbk b/doc/has_minus.qbk index 7139272..fdf4d9a 100644 --- a/doc/has_minus.qbk +++ b/doc/has_minus.qbk @@ -26,7 +26,7 @@ f(lhs-rhs); // is valid if has_minus::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_minus::value; // this is fine boost::has_minus::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 +#include + +template +struct contains { T data; }; + +template +bool operator-(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g-g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b-b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_minus_assign.qbk b/doc/has_minus_assign.qbk index 1d106bd..cbb4cba 100644 --- a/doc/has_minus_assign.qbk +++ b/doc/has_minus_assign.qbk @@ -26,7 +26,7 @@ f(lhs-=rhs); // is valid if has_minus_assign::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_minus_assign::value; // this is fine boost::has_minus_assign::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 +#include + +template +struct contains { T data; }; + +template +bool operator-=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g-=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b-=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_modulus.qbk b/doc/has_modulus.qbk index ae79258..589f3b1 100644 --- a/doc/has_modulus.qbk +++ b/doc/has_modulus.qbk @@ -26,7 +26,7 @@ f(lhs%rhs); // is valid if has_modulus::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -69,6 +69,40 @@ boost::has_modulus::value; // this is fine boost::has_modulus::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 +#include + +template +struct contains { T data; }; + +template +bool operator%(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g%g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b%b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_modulus_assign.qbk b/doc/has_modulus_assign.qbk index 68b8479..4441a70 100644 --- a/doc/has_modulus_assign.qbk +++ b/doc/has_modulus_assign.qbk @@ -26,7 +26,7 @@ f(lhs%=rhs); // is valid if has_modulus_assign::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -69,6 +69,40 @@ boost::has_modulus_assign::value; // this is fine boost::has_modulus_assign::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 +#include + +template +struct contains { T data; }; + +template +bool operator%=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g%=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b%=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_multiplies.qbk b/doc/has_multiplies.qbk index 6f0d491..9eaea40 100644 --- a/doc/has_multiplies.qbk +++ b/doc/has_multiplies.qbk @@ -26,7 +26,7 @@ f(lhs*rhs); // is valid if has_multiplies::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_multiplies::value; // this is fine boost::has_multiplies::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 +#include + +template +struct contains { T data; }; + +template +bool operator*(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g*g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b*b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_multiplies_assign.qbk b/doc/has_multiplies_assign.qbk index 3932d46..91b45e9 100644 --- a/doc/has_multiplies_assign.qbk +++ b/doc/has_multiplies_assign.qbk @@ -26,7 +26,7 @@ f(lhs*=rhs); // is valid if has_multiplies_assign::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_multiplies_assign::value; // this is fine boost::has_multiplies_assign::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 +#include + +template +struct contains { T data; }; + +template +bool operator*=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g*=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b*=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_negate.qbk b/doc/has_negate.qbk index d968210..15ea477 100644 --- a/doc/has_negate.qbk +++ b/doc/has_negate.qbk @@ -25,7 +25,7 @@ f(-rhs); // is valid if has_negate::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -70,6 +70,40 @@ boost::has_negate::value; // this is fine boost::has_negate::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 +#include + +template +struct contains { T data; }; + +template +bool operator-(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + -g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + -b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_not_equal_to.qbk b/doc/has_not_equal_to.qbk index 05231db..36626c5 100644 --- a/doc/has_not_equal_to.qbk +++ b/doc/has_not_equal_to.qbk @@ -26,7 +26,7 @@ f(lhs!=rhs); // is valid if has_not_equal_to::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_not_equal_to::value; // this is fine boost::has_not_equal_to::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 +#include + +template +struct contains { T data; }; + +template +bool operator!=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g!=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b!=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_plus.qbk b/doc/has_plus.qbk index c5cfc18..1dc790b 100644 --- a/doc/has_plus.qbk +++ b/doc/has_plus.qbk @@ -26,7 +26,7 @@ f(lhs+rhs); // is valid if has_plus::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_plus::value; // this is fine boost::has_plus::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 +#include + +template +struct contains { T data; }; + +template +bool operator+(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g+g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b+b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_plus_assign.qbk b/doc/has_plus_assign.qbk index e6cac56..be279e0 100644 --- a/doc/has_plus_assign.qbk +++ b/doc/has_plus_assign.qbk @@ -26,7 +26,7 @@ f(lhs+=rhs); // is valid if has_plus_assign::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -71,6 +71,40 @@ boost::has_plus_assign::value; // this is fine boost::has_plus_assign::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 +#include + +template +struct contains { T data; }; + +template +bool operator+=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g+=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b+=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_post_decrement.qbk b/doc/has_post_decrement.qbk index 1edfdbb..a3e8780 100644 --- a/doc/has_post_decrement.qbk +++ b/doc/has_post_decrement.qbk @@ -25,7 +25,7 @@ f(lhs--); // is valid if has_post_decrement::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -72,6 +72,40 @@ boost::has_post_decrement::value; // this is fine boost::has_post_decrement::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 +#include + +template +struct contains { T data; }; + +template +bool operator--(const contains &lhs, int) { + return f(lhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g--; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b--; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_post_increment.qbk b/doc/has_post_increment.qbk index 8e3fba6..ddd93eb 100644 --- a/doc/has_post_increment.qbk +++ b/doc/has_post_increment.qbk @@ -25,7 +25,7 @@ f(lhs++); // is valid if has_post_increment::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -72,6 +72,40 @@ boost::has_post_increment::value; // this is fine boost::has_post_increment::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 +#include + +template +struct contains { T data; }; + +template +bool operator++(const contains &lhs, int) { + return f(lhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g++; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b++; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_pre_decrement.qbk b/doc/has_pre_decrement.qbk index 94e61ab..5393d71 100644 --- a/doc/has_pre_decrement.qbk +++ b/doc/has_pre_decrement.qbk @@ -25,7 +25,7 @@ f(--rhs); // is valid if has_pre_decrement::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -72,6 +72,40 @@ boost::has_pre_decrement::value; // this is fine boost::has_pre_decrement::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 +#include + +template +struct contains { T data; }; + +template +bool operator--(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + --g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + --b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_pre_increment.qbk b/doc/has_pre_increment.qbk index fcd9b6e..74ef843 100644 --- a/doc/has_pre_increment.qbk +++ b/doc/has_pre_increment.qbk @@ -25,7 +25,7 @@ f(++rhs); // is valid if has_pre_increment::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -72,6 +72,40 @@ boost::has_pre_increment::value; // this is fine boost::has_pre_increment::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 +#include + +template +struct contains { T data; }; + +template +bool operator++(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + ++g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + ++b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_right_shift.qbk b/doc/has_right_shift.qbk index 8a7f9fb..7c342ff 100644 --- a/doc/has_right_shift.qbk +++ b/doc/has_right_shift.qbk @@ -26,7 +26,7 @@ f(lhs>>rhs); // is valid if has_right_shift::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -72,6 +72,40 @@ boost::has_right_shift::value; // this is fine boost::has_right_shift::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 +#include + +template +struct contains { T data; }; + +template +bool operator>>(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g>>g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b>>b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_right_shift_assign.qbk b/doc/has_right_shift_assign.qbk index 906e365..4538d20 100644 --- a/doc/has_right_shift_assign.qbk +++ b/doc/has_right_shift_assign.qbk @@ -26,7 +26,7 @@ f(lhs>>=rhs); // is valid if has_right_shift_assign::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -69,6 +69,40 @@ boost::has_right_shift_assign::value; // this is fine boost::has_right_shift_assign::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 +#include + +template +struct contains { T data; }; + +template +bool operator>>=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g>>=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b>>=b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_unary_minus.qbk b/doc/has_unary_minus.qbk index 913c32f..4758ba3 100644 --- a/doc/has_unary_minus.qbk +++ b/doc/has_unary_minus.qbk @@ -25,7 +25,7 @@ f(-rhs); // is valid if has_unary_minus::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -70,6 +70,40 @@ boost::has_unary_minus::value; // this is fine boost::has_unary_minus::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 +#include + +template +struct contains { T data; }; + +template +bool operator-(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + -g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + -b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/has_unary_plus.qbk b/doc/has_unary_plus.qbk index de8474e..43540ec 100644 --- a/doc/has_unary_plus.qbk +++ b/doc/has_unary_plus.qbk @@ -25,7 +25,7 @@ f(+rhs); // is valid if has_unary_plus::value==true `` If `Ret=void`, the return type is checked to be exactly `void`. -__header `#include ` or `#include ` +__header `#include ` or `#include ` or `#include ` __examples @@ -70,6 +70,40 @@ boost::has_unary_plus::value; // this is fine boost::has_unary_plus::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 +#include + +template +struct contains { T data; }; + +template +bool operator+(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + +g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + +b; // compile time error + return 0; +} +`` + * `volatile` qualifier is not properly handled and would lead to undefined behavior [endsect] diff --git a/doc/html/boost_typetraits/category/value_traits/operators.html b/doc/html/boost_typetraits/category/value_traits/operators.html index 82c062c..dc58ec3 100644 --- a/doc/html/boost_typetraits/category/value_traits/operators.html +++ b/doc/html/boost_typetraits/category/value_traits/operators.html @@ -1334,58 +1334,85 @@ Known issues -
  • +
      +
    • These traits cannot detect whether the operators are public or not: if an operator is defined as a private member of type T 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. -
    -

    - -

    + 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
     
    -

    -

    -
    • +
    • +
    • There is an issue if the operator exists only for type A and B is 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. -
    -

    - -

    + 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 { };
     struct A { A(const B&) { } };
     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 -
    +
  • +
Acknowledgments diff --git a/doc/html/boost_typetraits/reference/has_bit_and.html b/doc/html/boost_typetraits/reference/has_bit_and.html index a632076..aa501d4 100644 --- a/doc/html/boost_typetraits/reference/has_bit_and.html +++ b/doc/html/boost_typetraits/reference/has_bit_and.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_bit_and.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

Examples: @@ -128,6 +129,41 @@ struct B { operator A(); }; boost::has_bit_and<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_bit_and_assign.html b/doc/html/boost_typetraits/reference/has_bit_and_assign.html index 293e84f..58b29e9 100644 --- a/doc/html/boost_typetraits/reference/has_bit_and_assign.html +++ b/doc/html/boost_typetraits/reference/has_bit_and_assign.html @@ -60,6 +60,7 @@ 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: @@ -128,6 +129,41 @@ struct B { operator A(); }; boost::has_bit_and_assign<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_bit_or.html b/doc/html/boost_typetraits/reference/has_bit_or.html index 1d3f475..ab9287e 100644 --- a/doc/html/boost_typetraits/reference/has_bit_or.html +++ b/doc/html/boost_typetraits/reference/has_bit_or.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_bit_or.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -126,6 +127,41 @@ struct B { operator A(); }; boost::has_bit_or<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_bit_or_assign.html b/doc/html/boost_typetraits/reference/has_bit_or_assign.html index c637654..969ade9 100644 --- a/doc/html/boost_typetraits/reference/has_bit_or_assign.html +++ b/doc/html/boost_typetraits/reference/has_bit_or_assign.html @@ -60,6 +60,7 @@ 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: @@ -128,6 +129,41 @@ struct B { operator A(); }; boost::has_bit_or_assign<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_bit_xor.html b/doc/html/boost_typetraits/reference/has_bit_xor.html index 8f9af84..d1a282d 100644 --- a/doc/html/boost_typetraits/reference/has_bit_xor.html +++ b/doc/html/boost_typetraits/reference/has_bit_xor.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_bit_xor.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -126,6 +127,41 @@ struct B { operator A(); }; boost::has_bit_xor<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_bit_xor_assign.html b/doc/html/boost_typetraits/reference/has_bit_xor_assign.html index 59f8517..341274a 100644 --- a/doc/html/boost_typetraits/reference/has_bit_xor_assign.html +++ b/doc/html/boost_typetraits/reference/has_bit_xor_assign.html @@ -60,6 +60,7 @@ 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: @@ -128,6 +129,41 @@ struct B { operator A(); }; boost::has_bit_xor_assign<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_complement.html b/doc/html/boost_typetraits/reference/has_complement.html index 2a0bec2..20ed5b0 100644 --- a/doc/html/boost_typetraits/reference/has_complement.html +++ b/doc/html/boost_typetraits/reference/has_complement.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_complement.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -135,6 +136,41 @@ struct B { operator A(); }; boost::has_complement<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_dereference.html b/doc/html/boost_typetraits/reference/has_dereference.html index 83f92f0..2e6e4b1 100644 --- a/doc/html/boost_typetraits/reference/has_dereference.html +++ b/doc/html/boost_typetraits/reference/has_dereference.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_dereference.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -144,6 +145,41 @@ struct B { operator A(); }; boost::has_dereference<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_divides.html b/doc/html/boost_typetraits/reference/has_divides.html index f6e2bc0..cfe31af 100644 --- a/doc/html/boost_typetraits/reference/has_divides.html +++ b/doc/html/boost_typetraits/reference/has_divides.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_divides.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -132,6 +133,41 @@ struct B { operator A(); }; boost::has_divides<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_divides_assign.html b/doc/html/boost_typetraits/reference/has_divides_assign.html index 0aeca96..59ea88b 100644 --- a/doc/html/boost_typetraits/reference/has_divides_assign.html +++ b/doc/html/boost_typetraits/reference/has_divides_assign.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_divides_assign.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -134,6 +135,41 @@ struct B { operator A(); }; boost::has_divides_assign<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_equal_to.html b/doc/html/boost_typetraits/reference/has_equal_to.html index 7887be2..d12ce44 100644 --- a/doc/html/boost_typetraits/reference/has_equal_to.html +++ b/doc/html/boost_typetraits/reference/has_equal_to.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_equal_to.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -133,6 +134,41 @@ struct B { operator A(); }; boost::has_equal_to<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_greater.html b/doc/html/boost_typetraits/reference/has_greater.html index aa393a7..428e6cf 100644 --- a/doc/html/boost_typetraits/reference/has_greater.html +++ b/doc/html/boost_typetraits/reference/has_greater.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_greater.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -133,6 +134,41 @@ struct B { operator A(); }; boost::has_greater<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_greater_equal.html b/doc/html/boost_typetraits/reference/has_greater_equal.html index 528d106..6e86269 100644 --- a/doc/html/boost_typetraits/reference/has_greater_equal.html +++ b/doc/html/boost_typetraits/reference/has_greater_equal.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_greater_equal.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -133,6 +134,41 @@ struct B { operator A(); }; boost::has_greater_equal<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_left_shift.html b/doc/html/boost_typetraits/reference/has_left_shift.html index 7d3af3e..536a82d 100644 --- a/doc/html/boost_typetraits/reference/has_left_shift.html +++ b/doc/html/boost_typetraits/reference/has_left_shift.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_left_shift.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -140,6 +141,41 @@ struct B { operator A(); }; boost::has_left_shift<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_left_shift_assign.html b/doc/html/boost_typetraits/reference/has_left_shift_assign.html index 1ffc9b6..ccd2845 100644 --- a/doc/html/boost_typetraits/reference/has_left_shift_assign.html +++ b/doc/html/boost_typetraits/reference/has_left_shift_assign.html @@ -60,6 +60,7 @@ 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: @@ -128,6 +129,41 @@ struct B { operator A(); }; boost::has_left_shift_assign<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_less.html b/doc/html/boost_typetraits/reference/has_less.html index 82f631c..5e74681 100644 --- a/doc/html/boost_typetraits/reference/has_less.html +++ b/doc/html/boost_typetraits/reference/has_less.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_less.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -133,6 +134,41 @@ struct B { operator A(); }; boost::has_less<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_less_equal.html b/doc/html/boost_typetraits/reference/has_less_equal.html index 33fabaf..d442813 100644 --- a/doc/html/boost_typetraits/reference/has_less_equal.html +++ b/doc/html/boost_typetraits/reference/has_less_equal.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_less_equal.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -133,6 +134,41 @@ struct B { operator A(); }; boost::has_less_equal<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_logical_and.html b/doc/html/boost_typetraits/reference/has_logical_and.html index 472ce8c..eeceffd 100644 --- a/doc/html/boost_typetraits/reference/has_logical_and.html +++ b/doc/html/boost_typetraits/reference/has_logical_and.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_logical_and.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -131,6 +132,41 @@ struct B { operator A(); }; boost::has_logical_and<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_logical_not.html b/doc/html/boost_typetraits/reference/has_logical_not.html index a726249..99a65ba 100644 --- a/doc/html/boost_typetraits/reference/has_logical_not.html +++ b/doc/html/boost_typetraits/reference/has_logical_not.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_logical_not.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -131,6 +132,41 @@ struct B { operator A(); }; boost::has_logical_not<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_logical_or.html b/doc/html/boost_typetraits/reference/has_logical_or.html index 52ff07a..b697960 100644 --- a/doc/html/boost_typetraits/reference/has_logical_or.html +++ b/doc/html/boost_typetraits/reference/has_logical_or.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_logical_or.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -131,6 +132,41 @@ struct B { operator A(); }; boost::has_logical_or<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_minus.html b/doc/html/boost_typetraits/reference/has_minus.html index 1f3e725..ad4a2f6 100644 --- a/doc/html/boost_typetraits/reference/has_minus.html +++ b/doc/html/boost_typetraits/reference/has_minus.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_minus.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -132,6 +133,41 @@ struct B { operator A(); }; boost::has_minus<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_minus_assign.html b/doc/html/boost_typetraits/reference/has_minus_assign.html index 655962f..ee05bc6 100644 --- a/doc/html/boost_typetraits/reference/has_minus_assign.html +++ b/doc/html/boost_typetraits/reference/has_minus_assign.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_minus_assign.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -134,6 +135,41 @@ struct B { operator A(); }; boost::has_minus_assign<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_modulus.html b/doc/html/boost_typetraits/reference/has_modulus.html index 4a442fa..d55b7d9 100644 --- a/doc/html/boost_typetraits/reference/has_modulus.html +++ b/doc/html/boost_typetraits/reference/has_modulus.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_modulus.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -125,6 +126,41 @@ struct B { operator A(); }; boost::has_modulus<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_modulus_assign.html b/doc/html/boost_typetraits/reference/has_modulus_assign.html index 76b3ddc..fb98bec 100644 --- a/doc/html/boost_typetraits/reference/has_modulus_assign.html +++ b/doc/html/boost_typetraits/reference/has_modulus_assign.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_modulus_assign.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -127,6 +128,41 @@ struct B { operator A(); }; boost::has_modulus_assign<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_multiplies.html b/doc/html/boost_typetraits/reference/has_multiplies.html index 0a69ef9..76bbb67 100644 --- a/doc/html/boost_typetraits/reference/has_multiplies.html +++ b/doc/html/boost_typetraits/reference/has_multiplies.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_multiplies.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -132,6 +133,41 @@ struct B { operator A(); }; boost::has_multiplies<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_multiplies_assign.html b/doc/html/boost_typetraits/reference/has_multiplies_assign.html index 1f82baf..e9ada4d 100644 --- a/doc/html/boost_typetraits/reference/has_multiplies_assign.html +++ b/doc/html/boost_typetraits/reference/has_multiplies_assign.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_multiplies_assign.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -134,6 +135,41 @@ struct B { operator A(); }; boost::has_multiplies_assign<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_negate.html b/doc/html/boost_typetraits/reference/has_negate.html index 614896d..d397534 100644 --- a/doc/html/boost_typetraits/reference/has_negate.html +++ b/doc/html/boost_typetraits/reference/has_negate.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_negate.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -131,6 +132,41 @@ struct B { operator A(); }; boost::has_negate<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_not_equal_to.html b/doc/html/boost_typetraits/reference/has_not_equal_to.html index 1dd5d4b..91234d7 100644 --- a/doc/html/boost_typetraits/reference/has_not_equal_to.html +++ b/doc/html/boost_typetraits/reference/has_not_equal_to.html @@ -60,6 +60,7 @@ 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: @@ -133,6 +134,41 @@ struct B { operator A(); }; boost::has_not_equal_to<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_plus.html b/doc/html/boost_typetraits/reference/has_plus.html index 812db41..3a780c2 100644 --- a/doc/html/boost_typetraits/reference/has_plus.html +++ b/doc/html/boost_typetraits/reference/has_plus.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_plus.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -132,6 +133,41 @@ struct B { operator A(); }; boost::has_plus<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_plus_assign.html b/doc/html/boost_typetraits/reference/has_plus_assign.html index d057b9e..552ba55 100644 --- a/doc/html/boost_typetraits/reference/has_plus_assign.html +++ b/doc/html/boost_typetraits/reference/has_plus_assign.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_plus_assign.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -134,6 +135,41 @@ struct B { operator A(); }; boost::has_plus_assign<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_post_decrement.html b/doc/html/boost_typetraits/reference/has_post_decrement.html index c96b668..175023f 100644 --- a/doc/html/boost_typetraits/reference/has_post_decrement.html +++ b/doc/html/boost_typetraits/reference/has_post_decrement.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_post_decrement.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -141,6 +142,41 @@ struct B { operator A(); }; boost::has_post_decrement<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_post_increment.html b/doc/html/boost_typetraits/reference/has_post_increment.html index 90fb0fa..0830cb7 100644 --- a/doc/html/boost_typetraits/reference/has_post_increment.html +++ b/doc/html/boost_typetraits/reference/has_post_increment.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_post_increment.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -141,6 +142,41 @@ struct B { operator A(); }; boost::has_post_increment<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_pre_decrement.html b/doc/html/boost_typetraits/reference/has_pre_decrement.html index ac11a78..b141de4 100644 --- a/doc/html/boost_typetraits/reference/has_pre_decrement.html +++ b/doc/html/boost_typetraits/reference/has_pre_decrement.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_pre_decrement.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -141,6 +142,41 @@ struct B { operator A(); }; boost::has_pre_decrement<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_pre_increment.html b/doc/html/boost_typetraits/reference/has_pre_increment.html index b15494f..01818da 100644 --- a/doc/html/boost_typetraits/reference/has_pre_increment.html +++ b/doc/html/boost_typetraits/reference/has_pre_increment.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_pre_increment.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -141,6 +142,41 @@ struct B { operator A(); }; boost::has_pre_increment<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_right_shift.html b/doc/html/boost_typetraits/reference/has_right_shift.html index 225c35d..b3185b2 100644 --- a/doc/html/boost_typetraits/reference/has_right_shift.html +++ b/doc/html/boost_typetraits/reference/has_right_shift.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_right_shift.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -140,6 +141,41 @@ struct B { operator A(); }; boost::has_right_shift<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_right_shift_assign.html b/doc/html/boost_typetraits/reference/has_right_shift_assign.html index 756c9cf..0411afb 100644 --- a/doc/html/boost_typetraits/reference/has_right_shift_assign.html +++ b/doc/html/boost_typetraits/reference/has_right_shift_assign.html @@ -60,6 +60,7 @@ 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: @@ -132,6 +133,41 @@ struct B { operator A(); }; boost::has_right_shift_assign<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_unary_minus.html b/doc/html/boost_typetraits/reference/has_unary_minus.html index fa1e059..0320950 100644 --- a/doc/html/boost_typetraits/reference/has_unary_minus.html +++ b/doc/html/boost_typetraits/reference/has_unary_minus.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_unary_minus.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -131,6 +132,41 @@ struct B { operator A(); }; boost::has_unary_minus<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/boost_typetraits/reference/has_unary_plus.html b/doc/html/boost_typetraits/reference/has_unary_plus.html index c021195..9b76f44 100644 --- a/doc/html/boost_typetraits/reference/has_unary_plus.html +++ b/doc/html/boost_typetraits/reference/has_unary_plus.html @@ -60,6 +60,7 @@ Header: #include <boost/type_traits/has_unary_plus.hpp> or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp>

    Examples: @@ -131,6 +132,41 @@ struct B { operator A(); }; boost::has_unary_plus<A>::value; // this is fine 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;
    +}
     
  • diff --git a/doc/html/index.html b/doc/html/index.html index 8cef6df..87d3803 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -31,7 +31,7 @@ Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven Watanabe

    -

    +

    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)

    diff --git a/doc/html/index/s11.html b/doc/html/index/s11.html index 3b41cde..685ba2b 100644 --- a/doc/html/index/s11.html +++ b/doc/html/index/s11.html @@ -24,7 +24,7 @@

    -Class Index

    +Class Index
  • A C D E F H I M N O P R T

    F R T

    diff --git a/doc/html/index/s13.html b/doc/html/index/s13.html index 242d831..431b2ce 100644 --- a/doc/html/index/s13.html +++ b/doc/html/index/s13.html @@ -24,7 +24,7 @@

    -Macro Index

    +Macro Index

    B

    diff --git a/doc/html/index/s14.html b/doc/html/index/s14.html index a4ab146..b5a0eac 100644 --- a/doc/html/index/s14.html +++ b/doc/html/index/s14.html @@ -23,7 +23,7 @@

    -Index

    +Index

    A B C D E F H I M N O P R T U

    @@ -279,6 +279,7 @@
  • @@ -286,6 +287,7 @@
  • @@ -293,6 +295,7 @@
  • @@ -300,6 +303,7 @@
  • @@ -307,6 +311,7 @@
  • @@ -314,6 +319,7 @@
  • @@ -321,6 +327,7 @@
  • @@ -328,6 +335,7 @@
  • @@ -335,6 +343,7 @@
  • @@ -342,6 +351,7 @@
  • @@ -349,6 +359,8 @@
  • @@ -356,6 +368,7 @@
  • @@ -363,6 +376,7 @@
  • @@ -370,6 +384,7 @@
  • @@ -377,6 +392,7 @@
  • @@ -384,6 +400,7 @@
  • @@ -391,6 +408,7 @@
  • @@ -398,6 +416,7 @@
  • @@ -405,6 +424,7 @@
  • @@ -412,6 +432,7 @@
  • @@ -419,6 +440,7 @@
  • @@ -426,6 +448,7 @@
  • @@ -433,6 +456,7 @@
  • @@ -440,6 +464,7 @@
  • @@ -447,6 +472,7 @@
  • @@ -454,6 +480,7 @@
  • @@ -461,6 +488,7 @@
  • has_new_operator

  • @@ -494,6 +522,7 @@
  • @@ -505,6 +534,7 @@
  • @@ -512,6 +542,7 @@
  • @@ -519,6 +550,7 @@
  • @@ -526,6 +558,7 @@
  • @@ -533,6 +566,7 @@
  • @@ -540,6 +574,7 @@
  • @@ -547,6 +582,7 @@
  • @@ -554,6 +590,7 @@
  • @@ -600,6 +637,7 @@
  • dont_care

  • has_unary_minus

  • Operator Type Traits

  • +
  • trait

  • @@ -607,6 +645,7 @@
  • @@ -773,6 +812,7 @@
  • any

  • check

  • dont_care

  • +
  • has_equal_to

  • has_operator

  • has_unary_minus

  • integral_constant

  • @@ -786,6 +826,7 @@
  • Rhs_nocv

  • Rhs_noptr

  • Rhs_noref

  • +
  • trait

  • trait_impl

  • trait_impl1

  • @@ -861,6 +902,50 @@