mirror of
https://github.com/boostorg/type_traits.git
synced 2026-05-04 03:50:50 +02:00
added type trait extension to operator detection
[SVN r74782]
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_bit_and has_bit_and]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_bit_and : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs&rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs&rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator&`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs&rhs); // is valid if has_bit_and<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_bit_and.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_bit_and<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_bit_and<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_bit_and<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_bit_and<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_and<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_bit_and<const int, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_and<int, double, bool>` inherits from `__false_type`.]
|
||||
[:`has_bit_and<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator&` is public or not:
|
||||
if `operator&` is defined as a private member of `Lhs` then
|
||||
instantiating `has_bit_and<Lhs>` will produce a compiler error.
|
||||
For this reason `has_bit_and` cannot be used to determine whether a type has a public `operator&` or not.
|
||||
``
|
||||
struct A { private: void operator&(const A&); };
|
||||
boost::has_bit_and<A>::value; // error: A::operator&(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator&(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_bit_and<A>::value; // this is fine
|
||||
boost::has_bit_and<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_bit_and_assign has_bit_and_assign]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_bit_and_assign : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs&=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs&=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator&=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs&=rhs); // is valid if has_bit_and_assign<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_bit_and_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_bit_and_assign<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_bit_and_assign<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_bit_and_assign<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_bit_and_assign<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_and_assign<int, int, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_and_assign<const int, int>` inherits from `__false_type`.]
|
||||
[:`has_bit_and_assign<int, double, bool>` inherits from `__false_type`.]
|
||||
[:`has_bit_and_assign<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator&=` is public or not:
|
||||
if `operator&=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_bit_and_assign<Lhs>` will produce a compiler error.
|
||||
For this reason `has_bit_and_assign` cannot be used to determine whether a type has a public `operator&=` or not.
|
||||
``
|
||||
struct A { private: void operator&=(const A&); };
|
||||
boost::has_bit_and_assign<A>::value; // error: A::operator&=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator&=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_bit_and_assign<A>::value; // this is fine
|
||||
boost::has_bit_and_assign<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_bit_or has_bit_or]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_bit_or : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs|rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs|rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator|`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs|rhs); // is valid if has_bit_or<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_bit_or.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_bit_or<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_bit_or<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_bit_or<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_bit_or<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_or<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_bit_or<const int, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_or<int, double, bool>` inherits from `__false_type`.]
|
||||
[:`has_bit_or<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator|` is public or not:
|
||||
if `operator|` is defined as a private member of `Lhs` then
|
||||
instantiating `has_bit_or<Lhs>` will produce a compiler error.
|
||||
For this reason `has_bit_or` cannot be used to determine whether a type has a public `operator|` or not.
|
||||
``
|
||||
struct A { private: void operator|(const A&); };
|
||||
boost::has_bit_or<A>::value; // error: A::operator|(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator|(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_bit_or<A>::value; // this is fine
|
||||
boost::has_bit_or<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_bit_or_assign has_bit_or_assign]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_bit_or_assign : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs|=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs|=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator|=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs|=rhs); // is valid if has_bit_or_assign<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_bit_or_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_bit_or_assign<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_bit_or_assign<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_bit_or_assign<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_bit_or_assign<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_or_assign<int, int, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_or_assign<const int, int>` inherits from `__false_type`.]
|
||||
[:`has_bit_or_assign<int, double, bool>` inherits from `__false_type`.]
|
||||
[:`has_bit_or_assign<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator|=` is public or not:
|
||||
if `operator|=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_bit_or_assign<Lhs>` will produce a compiler error.
|
||||
For this reason `has_bit_or_assign` cannot be used to determine whether a type has a public `operator|=` or not.
|
||||
``
|
||||
struct A { private: void operator|=(const A&); };
|
||||
boost::has_bit_or_assign<A>::value; // error: A::operator|=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator|=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_bit_or_assign<A>::value; // this is fine
|
||||
boost::has_bit_or_assign<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_bit_xor has_bit_xor]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_bit_xor : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs^rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs^rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator^`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs^rhs); // is valid if has_bit_xor<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_bit_xor.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_bit_xor<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_bit_xor<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_bit_xor<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_bit_xor<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_xor<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_bit_xor<const int, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_xor<int, double, bool>` inherits from `__false_type`.]
|
||||
[:`has_bit_xor<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator^` is public or not:
|
||||
if `operator^` is defined as a private member of `Lhs` then
|
||||
instantiating `has_bit_xor<Lhs>` will produce a compiler error.
|
||||
For this reason `has_bit_xor` cannot be used to determine whether a type has a public `operator^` or not.
|
||||
``
|
||||
struct A { private: void operator^(const A&); };
|
||||
boost::has_bit_xor<A>::value; // error: A::operator^(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator^(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_bit_xor<A>::value; // this is fine
|
||||
boost::has_bit_xor<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_bit_xor_assign has_bit_xor_assign]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_bit_xor_assign : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs^=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs^=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator^=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs^=rhs); // is valid if has_bit_xor_assign<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_bit_xor_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_bit_xor_assign<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_bit_xor_assign<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_bit_xor_assign<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_bit_xor_assign<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_xor_assign<int, int, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_bit_xor_assign<const int, int>` inherits from `__false_type`.]
|
||||
[:`has_bit_xor_assign<int, double, bool>` inherits from `__false_type`.]
|
||||
[:`has_bit_xor_assign<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator^=` is public or not:
|
||||
if `operator^=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_bit_xor_assign<Lhs>` will produce a compiler error.
|
||||
For this reason `has_bit_xor_assign` cannot be used to determine whether a type has a public `operator^=` or not.
|
||||
``
|
||||
struct A { private: void operator^=(const A&); };
|
||||
boost::has_bit_xor_assign<A>::value; // error: A::operator^=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator^=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_bit_xor_assign<A>::value; // this is fine
|
||||
boost::has_bit_xor_assign<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_complement has_complement]
|
||||
template <class Rhs, class Ret=dont_care>
|
||||
struct has_complement : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `rhs` of type `Rhs` can be used in expression `~rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `~rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator~`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Rhs rhs;
|
||||
f(~rhs); // is valid if has_complement<Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_complement.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_complement<Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_complement<Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_complement<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_complement<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_complement<int, int>` inherits from `__true_type`.]
|
||||
[:`has_complement<int, long>` inherits from `__true_type`.]
|
||||
[:`has_complement<const int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_complement<int*>` inherits from `__false_type`.]
|
||||
[:`has_complement<double, double>` inherits from `__false_type`.]
|
||||
[:`has_complement<double, int>` inherits from `__false_type`.]
|
||||
[:`has_complement<int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether prefix `operator~` is public or not:
|
||||
if `operator~` is defined as a private member of `Rhs` then
|
||||
instantiating `has_complement<Rhs>` will produce a compiler error.
|
||||
For this reason `has_complement` cannot be used to determine whether a type has a public `operator~` or not.
|
||||
``
|
||||
struct A { private: void operator~(); };
|
||||
boost::has_complement<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.
|
||||
``
|
||||
struct A { };
|
||||
void operator~(const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_complement<A>::value; // this is fine
|
||||
boost::has_complement<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_dereference has_dereference]
|
||||
template <class Rhs, class Ret=dont_care>
|
||||
struct has_dereference : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `rhs` of type `Rhs` can be used in expression `*rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `*rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator*`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Rhs rhs;
|
||||
f(*rhs); // is valid if has_dereference<Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_dereference.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_dereference<Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_dereference<Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_dereference<int*>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_dereference<long*>` inherits from `__true_type`.]
|
||||
|
||||
|
||||
[:`has_dereference<int*, int>` inherits from `__true_type`.]
|
||||
[:`has_dereference<int*, const int>` inherits from `__true_type`.]
|
||||
[:`has_dereference<int const *>` inherits from `__true_type`.]
|
||||
[:`has_dereference<int * const>` inherits from `__true_type`.]
|
||||
[:`has_dereference<int const * const>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_dereference<int>` inherits from `__false_type`.]
|
||||
[:`has_dereference<double>` inherits from `__false_type`.]
|
||||
[:`has_dereference<void*>` inherits from `__false_type`.]
|
||||
[:`has_dereference<const int*, int&>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether prefix `operator*` is public or not:
|
||||
if `operator*` is defined as a private member of `Rhs` then
|
||||
instantiating `has_dereference<Rhs>` will produce a compiler error.
|
||||
For this reason `has_dereference` cannot be used to determine whether a type has a public `operator*` or not.
|
||||
``
|
||||
struct A { private: void operator*(); };
|
||||
boost::has_dereference<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.
|
||||
``
|
||||
struct A { };
|
||||
void operator*(const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_dereference<A>::value; // this is fine
|
||||
boost::has_dereference<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_divides has_divides]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_divides : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs/rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs/rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator/`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs/rhs); // is valid if has_divides<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_divides.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_divides<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_divides<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_divides<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_divides<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_divides<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_divides<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_divides<int, double, double>` inherits from `__true_type`.]
|
||||
[:`has_divides<int, double, int>` inherits from `__true_type`.]
|
||||
[:`has_divides<const int, int>::value` inherits from `__true_type`.]
|
||||
|
||||
[:`has_divides<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator/` is public or not:
|
||||
if `operator/` is defined as a private member of `Lhs` then
|
||||
instantiating `has_divides<Lhs>` will produce a compiler error.
|
||||
For this reason `has_divides` cannot be used to determine whether a type has a public `operator/` or not.
|
||||
``
|
||||
struct A { private: void operator/(const A&); };
|
||||
boost::has_divides<A>::value; // error: A::operator/(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator/(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_divides<A>::value; // this is fine
|
||||
boost::has_divides<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_divides_assign has_divides_assign]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_divides_assign : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs/=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs/=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator/=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs/=rhs); // is valid if has_divides_assign<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_divides_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_divides_assign<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_divides_assign<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_divides_assign<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_divides_assign<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_divides_assign<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_divides_assign<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_divides_assign<int, double, double>` inherits from `__true_type`.]
|
||||
[:`has_divides_assign<int, double, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_divides_assign<const int, int>::value` inherits from `__false_type`.]
|
||||
[:`has_divides_assign<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator/=` is public or not:
|
||||
if `operator/=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_divides_assign<Lhs>` will produce a compiler error.
|
||||
For this reason `has_divides_assign` cannot be used to determine whether a type has a public `operator/=` or not.
|
||||
``
|
||||
struct A { private: void operator/=(const A&); };
|
||||
boost::has_divides_assign<A>::value; // error: A::operator/=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator/=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_divides_assign<A>::value; // this is fine
|
||||
boost::has_divides_assign<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_equal_to has_equal_to]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_equal_to : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs==rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs==rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator==`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs==rhs); // is valid if has_equal_to<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_equal_to.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_equal_to<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_equal_to<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_equal_to<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_equal_to<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_equal_to<int, int, bool>` inherits from `__true_type`.]
|
||||
[:`has_equal_to<int, double, bool>` inherits from `__true_type`.]
|
||||
[:`has_equal_to<const int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_equal_to<int*, int>` inherits from `__false_type`.]
|
||||
[:`has_equal_to<int*, double*>` inherits from `__false_type`.]
|
||||
[:`has_equal_to<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator==` is public or not:
|
||||
if `operator==` is defined as a private member of `Lhs` then
|
||||
instantiating `has_equal_to<Lhs>` will produce a compiler error.
|
||||
For this reason `has_equal_to` cannot be used to determine whether a type has a public `operator==` or not.
|
||||
``
|
||||
struct A { private: void operator==(const A&); };
|
||||
boost::has_equal_to<A>::value; // error: A::operator==(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator==(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_equal_to<A>::value; // this is fine
|
||||
boost::has_equal_to<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_greater has_greater]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_greater : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs>rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs>rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator>`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs>rhs); // is valid if has_greater<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_greater.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_greater<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_greater<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_greater<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_greater<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_greater<int, int, bool>` inherits from `__true_type`.]
|
||||
[:`has_greater<int, double, bool>` inherits from `__true_type`.]
|
||||
[:`has_greater<const int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_greater<int*, int>` inherits from `__false_type`.]
|
||||
[:`has_greater<int*, double*>` inherits from `__false_type`.]
|
||||
[:`has_greater<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator>` is public or not:
|
||||
if `operator>` is defined as a private member of `Lhs` then
|
||||
instantiating `has_greater<Lhs>` will produce a compiler error.
|
||||
For this reason `has_greater` cannot be used to determine whether a type has a public `operator>` or not.
|
||||
``
|
||||
struct A { private: void operator>(const A&); };
|
||||
boost::has_greater<A>::value; // error: A::operator>(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator>(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_greater<A>::value; // this is fine
|
||||
boost::has_greater<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_greater_equal has_greater_equal]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_greater_equal : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs>=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs>=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator>=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs>=rhs); // is valid if has_greater_equal<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_greater_equal.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_greater_equal<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_greater_equal<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_greater_equal<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_greater_equal<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_greater_equal<int, int, bool>` inherits from `__true_type`.]
|
||||
[:`has_greater_equal<int, double, bool>` inherits from `__true_type`.]
|
||||
[:`has_greater_equal<const int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_greater_equal<int*, int>` inherits from `__false_type`.]
|
||||
[:`has_greater_equal<int*, double*>` inherits from `__false_type`.]
|
||||
[:`has_greater_equal<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator>=` is public or not:
|
||||
if `operator>=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_greater_equal<Lhs>` will produce a compiler error.
|
||||
For this reason `has_greater_equal` cannot be used to determine whether a type has a public `operator>=` or not.
|
||||
``
|
||||
struct A { private: void operator>=(const A&); };
|
||||
boost::has_greater_equal<A>::value; // error: A::operator>=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator>=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_greater_equal<A>::value; // this is fine
|
||||
boost::has_greater_equal<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_left_shift has_left_shift]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_left_shift : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs<<rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs<<rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator<<`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs<<rhs); // is valid if has_left_shift<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_left_shift.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_left_shift<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_left_shift<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_left_shift<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_left_shift<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_left_shift<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_left_shift<const int, int>` inherits from `__true_type`.]
|
||||
[:`has_left_shift<std::ostream, int>` inherits from `__true_type`.]
|
||||
[:`has_left_shift<std::ostream, char*, std::ostream>` inherits from `__true_type`.]
|
||||
[:`has_left_shift<std::ostream, std::string>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_left_shift<int, double, bool>` inherits from `__false_type`.]
|
||||
[:`has_left_shift<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator<<` is public or not:
|
||||
if `operator<<` is defined as a private member of `Lhs` then
|
||||
instantiating `has_left_shift<Lhs>` will produce a compiler error.
|
||||
For this reason `has_left_shift` cannot be used to determine whether a type has a public `operator<<` or not.
|
||||
``
|
||||
struct A { private: void operator<<(const A&); };
|
||||
boost::has_left_shift<A>::value; // error: A::operator<<(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator<<(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_left_shift<A>::value; // this is fine
|
||||
boost::has_left_shift<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_left_shift_assign has_left_shift_assign]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_left_shift_assign : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs<<=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs<<=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator<<=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs<<=rhs); // is valid if has_left_shift_assign<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_left_shift_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_left_shift_assign<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_left_shift_assign<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_left_shift_assign<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_left_shift_assign<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_left_shift_assign<int, int, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_left_shift_assign<const int, int>` inherits from `__false_type`.]
|
||||
[:`has_left_shift_assign<int, double, bool>` inherits from `__false_type`.]
|
||||
[:`has_left_shift_assign<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator<<=` is public or not:
|
||||
if `operator<<=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_left_shift_assign<Lhs>` will produce a compiler error.
|
||||
For this reason `has_left_shift_assign` cannot be used to determine whether a type has a public `operator<<=` or not.
|
||||
``
|
||||
struct A { private: void operator<<=(const A&); };
|
||||
boost::has_left_shift_assign<A>::value; // error: A::operator<<=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator<<=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_left_shift_assign<A>::value; // this is fine
|
||||
boost::has_left_shift_assign<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_less has_less]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_less : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs<rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs<rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator<`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs<rhs); // is valid if has_less<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_less.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_less<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_less<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_less<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_less<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_less<int, int, bool>` inherits from `__true_type`.]
|
||||
[:`has_less<int, double, bool>` inherits from `__true_type`.]
|
||||
[:`has_less<const int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_less<int*, int>` inherits from `__false_type`.]
|
||||
[:`has_less<int*, double*>` inherits from `__false_type`.]
|
||||
[:`has_less<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator<` is public or not:
|
||||
if `operator<` is defined as a private member of `Lhs` then
|
||||
instantiating `has_less<Lhs>` will produce a compiler error.
|
||||
For this reason `has_less` cannot be used to determine whether a type has a public `operator<` or not.
|
||||
``
|
||||
struct A { private: void operator<(const A&); };
|
||||
boost::has_less<A>::value; // error: A::operator<(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator<(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_less<A>::value; // this is fine
|
||||
boost::has_less<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_less_equal has_less_equal]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_less_equal : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs<=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs<=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator<=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs<=rhs); // is valid if has_less_equal<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_less_equal.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_less_equal<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_less_equal<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_less_equal<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_less_equal<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_less_equal<int, int, bool>` inherits from `__true_type`.]
|
||||
[:`has_less_equal<int, double, bool>` inherits from `__true_type`.]
|
||||
[:`has_less_equal<const int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_less_equal<int*, int>` inherits from `__false_type`.]
|
||||
[:`has_less_equal<int*, double*>` inherits from `__false_type`.]
|
||||
[:`has_less_equal<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator<=` is public or not:
|
||||
if `operator<=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_less_equal<Lhs>` will produce a compiler error.
|
||||
For this reason `has_less_equal` cannot be used to determine whether a type has a public `operator<=` or not.
|
||||
``
|
||||
struct A { private: void operator<=(const A&); };
|
||||
boost::has_less_equal<A>::value; // error: A::operator<=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator<=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_less_equal<A>::value; // this is fine
|
||||
boost::has_less_equal<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_logical_and has_logical_and]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_logical_and : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs&&rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs&&rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator&&`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs&&rhs); // is valid if has_logical_and<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_logical_and.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_logical_and<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_logical_and<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_logical_and<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_logical_and<bool>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_logical_and<int, int, bool>` inherits from `__true_type`.]
|
||||
[:`has_logical_and<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_logical_and<int, double, bool>` inherits from `__true_type`.]
|
||||
[:`has_logical_and<const int, int>::value` inherits from `__true_type`.]
|
||||
|
||||
[:`has_logical_and<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator&&` is public or not:
|
||||
if `operator&&` is defined as a private member of `Lhs` then
|
||||
instantiating `has_logical_and<Lhs>` will produce a compiler error.
|
||||
For this reason `has_logical_and` cannot be used to determine whether a type has a public `operator&&` or not.
|
||||
``
|
||||
struct A { private: void operator&&(const A&); };
|
||||
boost::has_logical_and<A>::value; // error: A::operator&&(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator&&(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_logical_and<A>::value; // this is fine
|
||||
boost::has_logical_and<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_logical_not has_logical_not]
|
||||
template <class Rhs, class Ret=dont_care>
|
||||
struct has_logical_not : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `rhs` of type `Rhs` can be used in expression `!rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `!rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator!`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Rhs rhs;
|
||||
f(!rhs); // is valid if has_logical_not<Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_logical_not.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_logical_not<Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_logical_not<Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_logical_not<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_logical_not<bool>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_logical_not<int, bool>` inherits from `__true_type`.]
|
||||
[:`has_logical_not<int, long>` inherits from `__true_type`.]
|
||||
[:`has_logical_not<double, double>` inherits from `__true_type`.]
|
||||
[:`has_logical_not<double, bool>` inherits from `__true_type`.]
|
||||
[:`has_logical_not<const bool>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_logical_not<int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether prefix `operator!` is public or not:
|
||||
if `operator!` is defined as a private member of `Rhs` then
|
||||
instantiating `has_logical_not<Rhs>` will produce a compiler error.
|
||||
For this reason `has_logical_not` cannot be used to determine whether a type has a public `operator!` or not.
|
||||
``
|
||||
struct A { private: void operator!(); };
|
||||
boost::has_logical_not<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.
|
||||
``
|
||||
struct A { };
|
||||
void operator!(const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_logical_not<A>::value; // this is fine
|
||||
boost::has_logical_not<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_logical_or has_logical_or]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_logical_or : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs||rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs||rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator||`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs||rhs); // is valid if has_logical_or<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_logical_or.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_logical_or<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_logical_or<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_logical_or<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_logical_or<bool>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_logical_or<int, int, bool>` inherits from `__true_type`.]
|
||||
[:`has_logical_or<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_logical_or<int, double, bool>` inherits from `__true_type`.]
|
||||
[:`has_logical_or<const int, int>::value` inherits from `__true_type`.]
|
||||
|
||||
[:`has_logical_or<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator||` is public or not:
|
||||
if `operator||` is defined as a private member of `Lhs` then
|
||||
instantiating `has_logical_or<Lhs>` will produce a compiler error.
|
||||
For this reason `has_logical_or` cannot be used to determine whether a type has a public `operator||` or not.
|
||||
``
|
||||
struct A { private: void operator||(const A&); };
|
||||
boost::has_logical_or<A>::value; // error: A::operator||(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator||(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_logical_or<A>::value; // this is fine
|
||||
boost::has_logical_or<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_minus has_minus]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_minus : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs-rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs-rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator-`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs-rhs); // is valid if has_minus<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_minus.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_minus<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_minus<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_minus<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_minus<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_minus<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_minus<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_minus<int, double, double>` inherits from `__true_type`.]
|
||||
[:`has_minus<int, double, int>` inherits from `__true_type`.]
|
||||
[:`has_minus<const int, int>::value` inherits from `__true_type`.]
|
||||
|
||||
[:`has_minus<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator-` is public or not:
|
||||
if `operator-` is defined as a private member of `Lhs` then
|
||||
instantiating `has_minus<Lhs>` will produce a compiler error.
|
||||
For this reason `has_minus` cannot be used to determine whether a type has a public `operator-` or not.
|
||||
``
|
||||
struct A { private: void operator-(const A&); };
|
||||
boost::has_minus<A>::value; // error: A::operator-(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator-(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_minus<A>::value; // this is fine
|
||||
boost::has_minus<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_minus_assign has_minus_assign]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_minus_assign : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs-=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs-=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator-=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs-=rhs); // is valid if has_minus_assign<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_minus_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_minus_assign<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_minus_assign<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_minus_assign<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_minus_assign<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_minus_assign<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_minus_assign<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_minus_assign<int, double, double>` inherits from `__true_type`.]
|
||||
[:`has_minus_assign<int, double, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_minus_assign<const int, int>::value` inherits from `__false_type`.]
|
||||
[:`has_minus_assign<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator-=` is public or not:
|
||||
if `operator-=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_minus_assign<Lhs>` will produce a compiler error.
|
||||
For this reason `has_minus_assign` cannot be used to determine whether a type has a public `operator-=` or not.
|
||||
``
|
||||
struct A { private: void operator-=(const A&); };
|
||||
boost::has_minus_assign<A>::value; // error: A::operator-=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator-=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_minus_assign<A>::value; // this is fine
|
||||
boost::has_minus_assign<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_modulus has_modulus]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_modulus : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs%rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs%rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator%`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs%rhs); // is valid if has_modulus<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_modulus.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_modulus<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_modulus<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_modulus<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_modulus<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_modulus<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_modulus<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_modulus<const int, int>::value` inherits from `__true_type`.]
|
||||
|
||||
[:`has_modulus<int, double>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator%` is public or not:
|
||||
if `operator%` is defined as a private member of `Lhs` then
|
||||
instantiating `has_modulus<Lhs>` will produce a compiler error.
|
||||
For this reason `has_modulus` cannot be used to determine whether a type has a public `operator%` or not.
|
||||
``
|
||||
struct A { private: void operator%(const A&); };
|
||||
boost::has_modulus<A>::value; // error: A::operator%(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator%(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_modulus<A>::value; // this is fine
|
||||
boost::has_modulus<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_modulus_assign has_modulus_assign]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_modulus_assign : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs%=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs%=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator%=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs%=rhs); // is valid if has_modulus_assign<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_modulus_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_modulus_assign<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_modulus_assign<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_modulus_assign<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_modulus_assign<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_modulus_assign<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_modulus_assign<int, int, long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_modulus_assign<const int, int>::value` inherits from `__false_type`.]
|
||||
[:`has_modulus_assign<int, double>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator%=` is public or not:
|
||||
if `operator%=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_modulus_assign<Lhs>` will produce a compiler error.
|
||||
For this reason `has_modulus_assign` cannot be used to determine whether a type has a public `operator%=` or not.
|
||||
``
|
||||
struct A { private: void operator%=(const A&); };
|
||||
boost::has_modulus_assign<A>::value; // error: A::operator%=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator%=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_modulus_assign<A>::value; // this is fine
|
||||
boost::has_modulus_assign<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_multiplies has_multiplies]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_multiplies : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs*rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs*rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator*`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs*rhs); // is valid if has_multiplies<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_multiplies.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_multiplies<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_multiplies<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_multiplies<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_multiplies<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_multiplies<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_multiplies<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_multiplies<int, double, double>` inherits from `__true_type`.]
|
||||
[:`has_multiplies<int, double, int>` inherits from `__true_type`.]
|
||||
[:`has_multiplies<const int, int>::value` inherits from `__true_type`.]
|
||||
|
||||
[:`has_multiplies<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator*` is public or not:
|
||||
if `operator*` is defined as a private member of `Lhs` then
|
||||
instantiating `has_multiplies<Lhs>` will produce a compiler error.
|
||||
For this reason `has_multiplies` cannot be used to determine whether a type has a public `operator*` or not.
|
||||
``
|
||||
struct A { private: void operator*(const A&); };
|
||||
boost::has_multiplies<A>::value; // error: A::operator*(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator*(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_multiplies<A>::value; // this is fine
|
||||
boost::has_multiplies<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_multiplies_assign has_multiplies_assign]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_multiplies_assign : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs*=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs*=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator*=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs*=rhs); // is valid if has_multiplies_assign<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_multiplies_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_multiplies_assign<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_multiplies_assign<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_multiplies_assign<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_multiplies_assign<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_multiplies_assign<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_multiplies_assign<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_multiplies_assign<int, double, double>` inherits from `__true_type`.]
|
||||
[:`has_multiplies_assign<int, double, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_multiplies_assign<const int, int>::value` inherits from `__false_type`.]
|
||||
[:`has_multiplies_assign<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator*=` is public or not:
|
||||
if `operator*=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_multiplies_assign<Lhs>` will produce a compiler error.
|
||||
For this reason `has_multiplies_assign` cannot be used to determine whether a type has a public `operator*=` or not.
|
||||
``
|
||||
struct A { private: void operator*=(const A&); };
|
||||
boost::has_multiplies_assign<A>::value; // error: A::operator*=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator*=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_multiplies_assign<A>::value; // this is fine
|
||||
boost::has_multiplies_assign<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_negate has_negate]
|
||||
template <class Rhs, class Ret=dont_care>
|
||||
struct has_negate : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `rhs` of type `Rhs` can be used in expression `-rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `-rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator-`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Rhs rhs;
|
||||
f(-rhs); // is valid if has_negate<Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_negate.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_negate<Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_negate<Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_negate<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_negate<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_negate<int, int>` inherits from `__true_type`.]
|
||||
[:`has_negate<int, long>` inherits from `__true_type`.]
|
||||
[:`has_negate<double, double>` inherits from `__true_type`.]
|
||||
[:`has_negate<double, int>` inherits from `__true_type`.]
|
||||
[:`has_negate<const int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_negate<int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether prefix `operator-` is public or not:
|
||||
if `operator-` is defined as a private member of `Rhs` then
|
||||
instantiating `has_negate<Rhs>` will produce a compiler error.
|
||||
For this reason `has_negate` cannot be used to determine whether a type has a public `operator-` or not.
|
||||
``
|
||||
struct A { private: void operator-(); };
|
||||
boost::has_negate<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.
|
||||
``
|
||||
struct A { };
|
||||
void operator-(const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_negate<A>::value; // this is fine
|
||||
boost::has_negate<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_not_equal_to has_not_equal_to]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_not_equal_to : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs!=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs!=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator!=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs!=rhs); // is valid if has_not_equal_to<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_not_equal_to.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_not_equal_to<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_not_equal_to<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_not_equal_to<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_not_equal_to<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_not_equal_to<int, int, bool>` inherits from `__true_type`.]
|
||||
[:`has_not_equal_to<int, double, bool>` inherits from `__true_type`.]
|
||||
[:`has_not_equal_to<const int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_not_equal_to<int*, int>` inherits from `__false_type`.]
|
||||
[:`has_not_equal_to<int*, double*>` inherits from `__false_type`.]
|
||||
[:`has_not_equal_to<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator!=` is public or not:
|
||||
if `operator!=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_not_equal_to<Lhs>` will produce a compiler error.
|
||||
For this reason `has_not_equal_to` cannot be used to determine whether a type has a public `operator!=` or not.
|
||||
``
|
||||
struct A { private: void operator!=(const A&); };
|
||||
boost::has_not_equal_to<A>::value; // error: A::operator!=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator!=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_not_equal_to<A>::value; // this is fine
|
||||
boost::has_not_equal_to<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_plus has_plus]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_plus : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs+rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs+rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator+`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs+rhs); // is valid if has_plus<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_plus.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_plus<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_plus<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_plus<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_plus<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_plus<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_plus<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_plus<int, double, double>` inherits from `__true_type`.]
|
||||
[:`has_plus<int, double, int>` inherits from `__true_type`.]
|
||||
[:`has_plus<const int, int>::value` inherits from `__true_type`.]
|
||||
|
||||
[:`has_plus<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator+` is public or not:
|
||||
if `operator+` is defined as a private member of `Lhs` then
|
||||
instantiating `has_plus<Lhs>` will produce a compiler error.
|
||||
For this reason `has_plus` cannot be used to determine whether a type has a public `operator+` or not.
|
||||
``
|
||||
struct A { private: void operator+(const A&); };
|
||||
boost::has_plus<A>::value; // error: A::operator+(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator+(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_plus<A>::value; // this is fine
|
||||
boost::has_plus<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_plus_assign has_plus_assign]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_plus_assign : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs+=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs+=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator+=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs+=rhs); // is valid if has_plus_assign<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_plus_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_plus_assign<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_plus_assign<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_plus_assign<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_plus_assign<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_plus_assign<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_plus_assign<int, int, long>` inherits from `__true_type`.]
|
||||
[:`has_plus_assign<int, double, double>` inherits from `__true_type`.]
|
||||
[:`has_plus_assign<int, double, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_plus_assign<const int, int>::value` inherits from `__false_type`.]
|
||||
[:`has_plus_assign<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator+=` is public or not:
|
||||
if `operator+=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_plus_assign<Lhs>` will produce a compiler error.
|
||||
For this reason `has_plus_assign` cannot be used to determine whether a type has a public `operator+=` or not.
|
||||
``
|
||||
struct A { private: void operator+=(const A&); };
|
||||
boost::has_plus_assign<A>::value; // error: A::operator+=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator+=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_plus_assign<A>::value; // this is fine
|
||||
boost::has_plus_assign<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_post_decrement has_post_decrement]
|
||||
template <class Lhs, class Ret=dont_care>
|
||||
struct has_post_decrement : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` can be used in expression `lhs--`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs--` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of postfix `operator--`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
f(lhs--); // is valid if has_post_decrement<Lhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_post_decrement.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_post_decrement<Lhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_post_decrement<Lhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_post_decrement<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_post_decrement<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_post_decrement<int, int>` inherits from `__true_type`.]
|
||||
[:`has_post_decrement<int, long>` inherits from `__true_type`.]
|
||||
[:`has_post_decrement<double, double>` inherits from `__true_type`.]
|
||||
[:`has_post_decrement<double, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_post_decrement<bool>` inherits from `__false_type`.]
|
||||
[:`has_post_decrement<const int>` inherits from `__false_type`.]
|
||||
[:`has_post_decrement<void*>` inherits from `__false_type`.]
|
||||
[:`has_post_decrement<int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether postfix `operator--` is public or not:
|
||||
if `operator--` is defined as a private member of `Lhs` then
|
||||
instantiating `has_post_decrement<Lhs>` will produce a compiler error.
|
||||
For this reason `has_post_decrement` cannot be used to determine whether a type has a public `operator--` or not.
|
||||
``
|
||||
struct A { private: void operator--(int); };
|
||||
boost::has_post_decrement<A>::value; // error: A::operator--(int) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator--(const A&, int);
|
||||
struct B { operator A(); };
|
||||
boost::has_post_decrement<A>::value; // this is fine
|
||||
boost::has_post_decrement<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_post_increment has_post_increment]
|
||||
template <class Lhs, class Ret=dont_care>
|
||||
struct has_post_increment : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` can be used in expression `lhs++`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs++` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of postfix `operator++`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
f(lhs++); // is valid if has_post_increment<Lhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_post_increment.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_post_increment<Lhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_post_increment<Lhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_post_increment<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_post_increment<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_post_increment<int, int>` inherits from `__true_type`.]
|
||||
[:`has_post_increment<int, long>` inherits from `__true_type`.]
|
||||
[:`has_post_increment<double, double>` inherits from `__true_type`.]
|
||||
[:`has_post_increment<double, int>` inherits from `__true_type`.]
|
||||
[:`has_post_increment<bool>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_post_increment<const int>` inherits from `__false_type`.]
|
||||
[:`has_post_increment<void*>` inherits from `__false_type`.]
|
||||
[:`has_post_increment<int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether postfix `operator++` is public or not:
|
||||
if `operator++` is defined as a private member of `Lhs` then
|
||||
instantiating `has_post_increment<Lhs>` will produce a compiler error.
|
||||
For this reason `has_post_increment` cannot be used to determine whether a type has a public `operator++` or not.
|
||||
``
|
||||
struct A { private: void operator++(int); };
|
||||
boost::has_post_increment<A>::value; // error: A::operator++(int) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator++(const A&, int);
|
||||
struct B { operator A(); };
|
||||
boost::has_post_increment<A>::value; // this is fine
|
||||
boost::has_post_increment<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_pre_decrement has_pre_decrement]
|
||||
template <class Rhs, class Ret=dont_care>
|
||||
struct has_pre_decrement : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `rhs` of type `Rhs` can be used in expression `--rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `--rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator--`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Rhs rhs;
|
||||
f(--rhs); // is valid if has_pre_decrement<Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_pre_decrement.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_pre_decrement<Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_pre_decrement<Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_pre_decrement<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_pre_decrement<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_pre_decrement<int, int>` inherits from `__true_type`.]
|
||||
[:`has_pre_decrement<int, long>` inherits from `__true_type`.]
|
||||
[:`has_pre_decrement<double, double>` inherits from `__true_type`.]
|
||||
[:`has_pre_decrement<double, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_pre_decrement<bool>` inherits from `__false_type`.]
|
||||
[:`has_pre_decrement<const int>` inherits from `__false_type`.]
|
||||
[:`has_pre_decrement<void*>` inherits from `__false_type`.]
|
||||
[:`has_pre_decrement<int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether prefix `operator--` is public or not:
|
||||
if `operator--` is defined as a private member of `Rhs` then
|
||||
instantiating `has_pre_decrement<Rhs>` will produce a compiler error.
|
||||
For this reason `has_pre_decrement` cannot be used to determine whether a type has a public `operator--` or not.
|
||||
``
|
||||
struct A { private: void operator--(); };
|
||||
boost::has_pre_decrement<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.
|
||||
``
|
||||
struct A { };
|
||||
void operator--(const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_pre_decrement<A>::value; // this is fine
|
||||
boost::has_pre_decrement<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_pre_increment has_pre_increment]
|
||||
template <class Rhs, class Ret=dont_care>
|
||||
struct has_pre_increment : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `rhs` of type `Rhs` can be used in expression `++rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `++rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator++`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Rhs rhs;
|
||||
f(++rhs); // is valid if has_pre_increment<Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_pre_increment.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_pre_increment<Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_pre_increment<Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_pre_increment<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_pre_increment<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_pre_increment<int, int>` inherits from `__true_type`.]
|
||||
[:`has_pre_increment<int, long>` inherits from `__true_type`.]
|
||||
[:`has_pre_increment<double, double>` inherits from `__true_type`.]
|
||||
[:`has_pre_increment<double, int>` inherits from `__true_type`.]
|
||||
[:`has_pre_increment<bool>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_pre_increment<const int>` inherits from `__false_type`.]
|
||||
[:`has_pre_increment<void*>` inherits from `__false_type`.]
|
||||
[:`has_pre_increment<int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether prefix `operator++` is public or not:
|
||||
if `operator++` is defined as a private member of `Rhs` then
|
||||
instantiating `has_pre_increment<Rhs>` will produce a compiler error.
|
||||
For this reason `has_pre_increment` cannot be used to determine whether a type has a public `operator++` or not.
|
||||
``
|
||||
struct A { private: void operator++(); };
|
||||
boost::has_pre_increment<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.
|
||||
``
|
||||
struct A { };
|
||||
void operator++(const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_pre_increment<A>::value; // this is fine
|
||||
boost::has_pre_increment<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_right_shift has_right_shift]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_right_shift : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs>>rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs>>rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator>>`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs>>rhs); // is valid if has_right_shift<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_right_shift.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_right_shift<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_right_shift<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_right_shift<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_right_shift<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_right_shift<int, int, int>` inherits from `__true_type`.]
|
||||
[:`has_right_shift<const int, int>` inherits from `__true_type`.]
|
||||
[:`has_right_shift<std::istream, int&>` inherits from `__true_type`.]
|
||||
[:`has_right_shift<std::istream, char*, std::ostream>` inherits from `__true_type`.]
|
||||
[:`has_right_shift<std::istream, std::string&>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_right_shift<int, double, bool>` inherits from `__false_type`.]
|
||||
[:`has_right_shift<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator>>` is public or not:
|
||||
if `operator>>` is defined as a private member of `Lhs` then
|
||||
instantiating `has_right_shift<Lhs>` will produce a compiler error.
|
||||
For this reason `has_right_shift` cannot be used to determine whether a type has a public `operator>>` or not.
|
||||
``
|
||||
struct A { private: void operator>>(const A&); };
|
||||
boost::has_right_shift<A>::value; // error: A::operator>>(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator>>(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_right_shift<A>::value; // this is fine
|
||||
boost::has_right_shift<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_right_shift_assign has_right_shift_assign]
|
||||
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
|
||||
struct has_right_shift_assign : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs>>=rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `lhs>>=rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator>>=`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Lhs lhs;
|
||||
Rhs rhs;
|
||||
f(lhs>>=rhs); // is valid if has_right_shift_assign<Lhs, Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_right_shift_assign.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_right_shift_assign<Lhs, Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_right_shift_assign<Lhs, Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_right_shift_assign<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_right_shift_assign<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_right_shift_assign<int, int, int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_right_shift_assign<const int, int>` inherits from `__false_type`.]
|
||||
[:`has_right_shift_assign<int, double, bool>` inherits from `__false_type`.]
|
||||
[:`has_right_shift_assign<int, int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether binary `operator>>=` is public or not:
|
||||
if `operator>>=` is defined as a private member of `Lhs` then
|
||||
instantiating `has_right_shift_assign<Lhs>` will produce a compiler error.
|
||||
For this reason `has_right_shift_assign` cannot be used to determine whether a type has a public `operator>>=` or not.
|
||||
``
|
||||
struct A { private: void operator>>=(const A&); };
|
||||
boost::has_right_shift_assign<A>::value; // error: A::operator>>=(const A&) 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.
|
||||
``
|
||||
struct A { };
|
||||
void operator>>=(const A&, const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_right_shift_assign<A>::value; // this is fine
|
||||
boost::has_right_shift_assign<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_unary_minus has_unary_minus]
|
||||
template <class Rhs, class Ret=dont_care>
|
||||
struct has_unary_minus : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `rhs` of type `Rhs` can be used in expression `-rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `-rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator-`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Rhs rhs;
|
||||
f(-rhs); // is valid if has_unary_minus<Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_unary_minus.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_unary_minus<Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_unary_minus<Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_unary_minus<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_unary_minus<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_unary_minus<int, int>` inherits from `__true_type`.]
|
||||
[:`has_unary_minus<int, long>` inherits from `__true_type`.]
|
||||
[:`has_unary_minus<double, double>` inherits from `__true_type`.]
|
||||
[:`has_unary_minus<double, int>` inherits from `__true_type`.]
|
||||
[:`has_unary_minus<const int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_unary_minus<int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether prefix `operator-` is public or not:
|
||||
if `operator-` is defined as a private member of `Rhs` then
|
||||
instantiating `has_unary_minus<Rhs>` will produce a compiler error.
|
||||
For this reason `has_unary_minus` cannot be used to determine whether a type has a public `operator-` or not.
|
||||
``
|
||||
struct A { private: void 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.
|
||||
``
|
||||
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
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
[/
|
||||
(C) Copyright 2009-2011 Frederic Bron.
|
||||
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).
|
||||
]
|
||||
|
||||
[section:has_unary_plus has_unary_plus]
|
||||
template <class Rhs, class Ret=dont_care>
|
||||
struct has_unary_plus : public __tof {};
|
||||
|
||||
__inherit
|
||||
If (i) `rhs` of type `Rhs` can be used in expression `+rhs`,
|
||||
and (ii) `Ret=dont_care` or the result of expression `+rhs` is convertible to `Ret`
|
||||
then inherits from __true_type,
|
||||
otherwise inherits from __false_type.
|
||||
|
||||
The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator+`.
|
||||
If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`.
|
||||
Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`:
|
||||
``
|
||||
void f(Ret);
|
||||
Rhs rhs;
|
||||
f(+rhs); // is valid if has_unary_plus<Rhs, Ret>::value==true
|
||||
``
|
||||
If `Ret=void`, the return type is checked to be exactly `void`.
|
||||
|
||||
__header `#include <boost/type_traits/has_unary_plus.hpp>` or `#include <boost/type_traits/has_operator.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
[:`has_unary_plus<Rhs, Ret>::value_type` is the type `bool`.]
|
||||
[:`has_unary_plus<Rhs, Ret>::value` is a `bool` integral constant expression.]
|
||||
[:`has_unary_plus<int>::value` is a `bool` integral constant expression that evaluates to `true`.]
|
||||
[:`has_unary_plus<long>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_unary_plus<int, int>` inherits from `__true_type`.]
|
||||
[:`has_unary_plus<int, long>` inherits from `__true_type`.]
|
||||
[:`has_unary_plus<double, double>` inherits from `__true_type`.]
|
||||
[:`has_unary_plus<double, int>` inherits from `__true_type`.]
|
||||
[:`has_unary_plus<const int>` inherits from `__true_type`.]
|
||||
|
||||
[:`has_unary_plus<int, std::string>` inherits from `__false_type`.]
|
||||
|
||||
|
||||
[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits]
|
||||
|
||||
[*Known issues:]
|
||||
|
||||
* This trait cannot detect whether prefix `operator+` is public or not:
|
||||
if `operator+` is defined as a private member of `Rhs` then
|
||||
instantiating `has_unary_plus<Rhs>` will produce a compiler error.
|
||||
For this reason `has_unary_plus` cannot be used to determine whether a type has a public `operator+` or not.
|
||||
``
|
||||
struct A { private: void operator+(); };
|
||||
boost::has_unary_plus<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.
|
||||
``
|
||||
struct A { };
|
||||
void operator+(const A&);
|
||||
struct B { operator A(); };
|
||||
boost::has_unary_plus<A>::value; // this is fine
|
||||
boost::has_unary_plus<B>::value; // error: ambiguous overload
|
||||
``
|
||||
|
||||
* `volatile` qualifier is not properly handled and would lead to undefined behavior
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Background and Tutorial</title>
|
||||
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="prev" href="intro.html" title="Introduction">
|
||||
@@ -669,10 +669,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Type Traits by Category</title>
|
||||
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="prev" href="background.html" title="Background and Tutorial">
|
||||
@@ -36,6 +36,8 @@
|
||||
Type Properties</a></span></dt>
|
||||
<dt><span class="section"><a href="category/value_traits/relate.html">Relationships
|
||||
Between Two Types</a></span></dt>
|
||||
<dt><span class="section"><a href="category/value_traits/operators.html">Operator
|
||||
Type Traits</a></span></dt>
|
||||
</dl></dd>
|
||||
<dt><span class="section"><a href="category/transform.html">Type Traits that
|
||||
Transform One Type to Another</a></span></dt>
|
||||
@@ -47,10 +49,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Synthesizing Types with Specific Alignments</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../category.html" title="Type Traits by Category">
|
||||
<link rel="prev" href="transform.html" title="Type Traits that Transform One Type to Another">
|
||||
@@ -45,10 +45,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Decomposing Function Types</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../category.html" title="Type Traits by Category">
|
||||
<link rel="prev" href="alignment.html" title="Synthesizing Types with Specific Alignments">
|
||||
@@ -42,10 +42,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Type Traits that Transform One Type to Another</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../category.html" title="Type Traits by Category">
|
||||
<link rel="prev" href="value_traits/relate.html" title="Relationships Between Two Types">
|
||||
<link rel="prev" href="value_traits/operators.html" title="Operator Type Traits">
|
||||
<link rel="next" href="alignment.html" title="Synthesizing Types with Specific Alignments">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
@@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="value_traits/relate.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../category.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="alignment.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="value_traits/operators.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../category.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="alignment.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@@ -161,10 +161,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
@@ -172,7 +173,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="value_traits/relate.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../category.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="alignment.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="value_traits/operators.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../category.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="alignment.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Type Traits that Describe the Properties of a Type</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../category.html" title="Type Traits by Category">
|
||||
<link rel="prev" href="../category.html" title="Type Traits by Category">
|
||||
@@ -34,6 +34,8 @@
|
||||
Type Properties</a></span></dt>
|
||||
<dt><span class="section"><a href="value_traits/relate.html">Relationships
|
||||
Between Two Types</a></span></dt>
|
||||
<dt><span class="section"><a href="value_traits/operators.html">Operator
|
||||
Type Traits</a></span></dt>
|
||||
</dl></div>
|
||||
<p>
|
||||
These traits are all <span class="emphasis"><em>value traits</em></span>, which is to say the
|
||||
@@ -48,10 +50,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Categorizing a Type</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../value_traits.html" title="Type Traits that Describe the Properties of a Type">
|
||||
<link rel="prev" href="../value_traits.html" title="Type Traits that Describe the Properties of a Type">
|
||||
@@ -119,10 +119,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>General Type Properties</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../value_traits.html" title="Type Traits that Describe the Properties of a Type">
|
||||
<link rel="prev" href="primary.html" title="Categorizing a Type">
|
||||
@@ -111,10 +111,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Relationships Between Two Types</title>
|
||||
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../value_traits.html" title="Type Traits that Describe the Properties of a Type">
|
||||
<link rel="prev" href="properties.html" title="General Type Properties">
|
||||
<link rel="next" href="../transform.html" title="Type Traits that Transform One Type to Another">
|
||||
<link rel="next" href="operators.html" title="Operator Type Traits">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
@@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="properties.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../value_traits.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../transform.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="properties.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../value_traits.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="operators.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
@@ -49,10 +49,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
@@ -60,7 +61,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="properties.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../value_traits.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../transform.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="properties.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../value_traits.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="operators.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Credits</title>
|
||||
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="prev" href="history.html" title="History">
|
||||
@@ -62,10 +62,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Examples</title>
|
||||
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="prev" href="mpl.html" title="MPL Interoperability">
|
||||
@@ -43,10 +43,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>An Optimized Version of std::copy</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../examples.html" title="Examples">
|
||||
<link rel="prev" href="../examples.html" title="Examples">
|
||||
@@ -78,10 +78,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>An Example that Omits Destructor Calls For Types with Trivial Destructors</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../examples.html" title="Examples">
|
||||
<link rel="prev" href="fill.html" title="An Optimised Version of std::fill">
|
||||
@@ -65,10 +65,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>An Optimised Version of std::fill</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../examples.html" title="Examples">
|
||||
<link rel="prev" href="copy.html" title="An Optimized Version of std::copy">
|
||||
@@ -72,10 +72,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Improving std::min with common_type</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../examples.html" title="Examples">
|
||||
<link rel="prev" href="to_double.html" title="Convert Numeric Types and Enums to double">
|
||||
@@ -47,10 +47,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>An improved Version of std::iter_swap</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../examples.html" title="Examples">
|
||||
<link rel="prev" href="destruct.html" title="An Example that Omits Destructor Calls For Types with Trivial Destructors">
|
||||
@@ -81,10 +81,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Convert Numeric Types and Enums to double</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../examples.html" title="Examples">
|
||||
<link rel="prev" href="iter.html" title="An improved Version of std::iter_swap">
|
||||
@@ -41,10 +41,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>History</title>
|
||||
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="prev" href="reference/type_with_alignment.html" title="type_with_alignment">
|
||||
@@ -82,10 +82,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Support for Compiler Intrinsics</title>
|
||||
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="prev" href="user_defined.html" title="User Defined Specializations">
|
||||
@@ -99,7 +99,7 @@
|
||||
of the following macros:
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.intrinsics.macros_for_compiler_intrinsics"></a><p class="title"><b>Table 1.4. Macros for Compiler Intrinsics</b></p>
|
||||
<a name="boost_typetraits.intrinsics.macros_for_compiler_intrinsics"></a><p class="title"><b>Table 1.9. Macros for Compiler Intrinsics</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Macros for Compiler Intrinsics">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -339,10 +339,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Introduction</title>
|
||||
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="prev" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
@@ -48,10 +48,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>MPL Interoperability</title>
|
||||
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="prev" href="intrinsics.html" title="Support for Compiler Intrinsics">
|
||||
@@ -45,10 +45,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Alphabetical Reference</title>
|
||||
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="prev" href="examples/improved_min.html" title="Improving std::min with common_type">
|
||||
@@ -42,18 +42,56 @@
|
||||
<dt><span class="section"><a href="reference/extent.html">extent</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/floating_point_promotion.html">floating_point_promotion</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/function_traits.html">function_traits</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_bit_and.html">has_bit_and</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_bit_and_assign.html">has_bit_and_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_bit_or.html">has_bit_or</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_bit_or_assign.html">has_bit_or_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_bit_xor.html">has_bit_xor</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_bit_xor_assign.html">has_bit_xor_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_complement.html">has_complement</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_dereference.html">has_dereference</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_divides.html">has_divides</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_divides_assign.html">has_divides_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_equal_to.html">has_equal_to</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_greater.html">has_greater</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_greater_equal.html">has_greater_equal</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_left_shift.html">has_left_shift</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_left_shift_assign.html">has_left_shift_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_less.html">has_less</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_less_equal.html">has_less_equal</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_logical_and.html">has_logical_and</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_logical_not.html">has_logical_not</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_logical_or.html">has_logical_or</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_minus.html">has_minus</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_minus_assign.html">has_minus_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_modulus.html">has_modulus</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_modulus_assign.html">has_modulus_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_multiplies.html">has_multiplies</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_multiplies_assign.html">has_multiplies_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_negate.html">has_negate</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_new_operator.html">has_new_operator</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_not_equal_to.html">has_not_equal_to</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_nothrow_assign.html">has_nothrow_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_nothrow_constructor.html">has_nothrow_constructor</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_nothrow_copy.html">has_nothrow_copy</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_nothrow_cp_cons.html">has_nothrow_copy_constructor</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_no_throw_def_cons.html">has_nothrow_default_constructor</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_plus.html">has_plus</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_plus_assign.html">has_plus_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_post_decrement.html">has_post_decrement</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_post_increment.html">has_post_increment</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_pre_decrement.html">has_pre_decrement</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_pre_increment.html">has_pre_increment</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_right_shift.html">has_right_shift</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_right_shift_assign.html">has_right_shift_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_trivial_assign.html">has_trivial_assign</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_trivial_constructor.html">has_trivial_constructor</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_trivial_copy.html">has_trivial_copy</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_trivial_cp_cons.html">has_trivial_copy_constructor</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_trivial_def_cons.html">has_trivial_default_constructor</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_trivial_destructor.html">has_trivial_destructor</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_unary_minus.html">has_unary_minus</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_unary_plus.html">has_unary_plus</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/has_virtual_destructor.html">has_virtual_destructor</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/integral_constant.html">integral_constant</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/integral_promotion.html">integral_promotion</a></span></dt>
|
||||
@@ -107,10 +145,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>add_const</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="../reference.html" title="Alphabetical Reference">
|
||||
@@ -53,7 +53,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.add_const.examples"></a><p class="title"><b>Table 1.5. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.add_const.examples"></a><p class="title"><b>Table 1.10. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -128,10 +128,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>add_cv</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="add_const.html" title="add_const">
|
||||
@@ -54,7 +54,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.add_cv.examples"></a><p class="title"><b>Table 1.6. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.add_cv.examples"></a><p class="title"><b>Table 1.11. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -131,10 +131,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>add_lvalue_reference</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="add_cv.html" title="add_cv">
|
||||
@@ -58,7 +58,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.add_lvalue_reference.examples"></a><p class="title"><b>Table 1.7. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.add_lvalue_reference.examples"></a><p class="title"><b>Table 1.12. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -157,10 +157,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>add_pointer</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="add_lvalue_reference.html" title="add_lvalue_reference">
|
||||
@@ -56,7 +56,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.add_pointer.examples"></a><p class="title"><b>Table 1.8. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.add_pointer.examples"></a><p class="title"><b>Table 1.13. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -130,10 +130,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>add_reference</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="add_pointer.html" title="add_pointer">
|
||||
@@ -65,7 +65,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.add_reference.examples"></a><p class="title"><b>Table 1.9. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.add_reference.examples"></a><p class="title"><b>Table 1.14. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -139,10 +139,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>add_rvalue_reference</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="add_reference.html" title="add_reference">
|
||||
@@ -56,7 +56,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.add_rvalue_reference.examples"></a><p class="title"><b>Table 1.10. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.add_rvalue_reference.examples"></a><p class="title"><b>Table 1.15. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -155,10 +155,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>add_volatile</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="add_rvalue_reference.html" title="add_rvalue_reference">
|
||||
@@ -53,7 +53,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.add_volatile.examples"></a><p class="title"><b>Table 1.11. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.add_volatile.examples"></a><p class="title"><b>Table 1.16. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -129,10 +129,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>aligned_storage</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="add_volatile.html" title="add_volatile">
|
||||
@@ -45,10 +45,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>alignment_of</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="aligned_storage.html" title="aligned_storage">
|
||||
@@ -65,10 +65,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>common_type</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="conditional.html" title="conditional">
|
||||
@@ -335,10 +335,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>conditional</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="alignment_of.html" title="alignment_of">
|
||||
@@ -45,10 +45,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>decay</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="common_type.html" title="common_type">
|
||||
@@ -48,7 +48,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.decay.examples"></a><p class="title"><b>Table 1.12. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.decay.examples"></a><p class="title"><b>Table 1.17. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -134,10 +134,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>extent</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="decay.html" title="decay">
|
||||
@@ -91,10 +91,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>floating_point_promotion</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="extent.html" title="extent">
|
||||
@@ -48,7 +48,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.floating_point_promotion.examples"></a><p class="title"><b>Table 1.13. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.floating_point_promotion.examples"></a><p class="title"><b>Table 1.18. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -111,10 +111,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>function_traits</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="floating_point_promotion.html" title="floating_point_promotion">
|
||||
<link rel="next" href="has_new_operator.html" title="has_new_operator">
|
||||
<link rel="next" href="has_bit_and.html" title="has_bit_and">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
@@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="floating_point_promotion.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_new_operator.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="floating_point_promotion.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_and.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@@ -59,7 +59,7 @@
|
||||
</p></td></tr>
|
||||
</table></div>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.function_traits.function_traits_members"></a><p class="title"><b>Table 1.14. Function Traits Members</b></p>
|
||||
<a name="boost_typetraits.reference.function_traits.function_traits_members"></a><p class="title"><b>Table 1.19. Function Traits Members</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Function Traits Members">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -122,7 +122,7 @@
|
||||
</table></div>
|
||||
</div>
|
||||
<br class="table-break"><div class="table">
|
||||
<a name="boost_typetraits.reference.function_traits.examples"></a><p class="title"><b>Table 1.15. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.function_traits.examples"></a><p class="title"><b>Table 1.20. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@@ -267,10 +267,11 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams,
|
||||
Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat
|
||||
Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
|
||||
Ramey and Jeremy Siek<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
@@ -278,7 +279,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="floating_point_promotion.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_new_operator.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="floating_point_promotion.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_and.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_bit_and</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="function_traits.html" title="function_traits">
|
||||
<link rel="next" href="has_bit_and_assign.html" title="has_bit_and_assign">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="function_traits.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_and_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_bit_and"></a><a class="link" href="has_bit_and.html" title="has_bit_and">has_bit_and</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_bit_and</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">&</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">&</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">&</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">&</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_bit_and<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_and</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">&</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">&</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_bit_and</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_bit_and</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">&</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">&(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_and</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator&(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">&(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_and</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_and</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="function_traits.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_and_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,150 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_bit_and_assign</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_bit_and.html" title="has_bit_and">
|
||||
<link rel="next" href="has_bit_or.html" title="has_bit_or">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_and.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_or.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_bit_and_assign"></a><a class="link" href="has_bit_and_assign.html" title="has_bit_and_assign">has_bit_and_assign</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_bit_and_assign</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">&=</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">&=</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">&=</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">&=</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_bit_and_assign<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_and_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">&=</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">&=</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_bit_and_assign</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">&=</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">&=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator&=(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">&=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_and_assign</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_and.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_or.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,148 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_bit_or</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_bit_and_assign.html" title="has_bit_and_assign">
|
||||
<link rel="next" href="has_bit_or_assign.html" title="has_bit_or_assign">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_and_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_or_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_bit_or"></a><a class="link" href="has_bit_or.html" title="has_bit_or">has_bit_or</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_bit_or</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">|</span><span class="identifier">rhs</span></code>, and
|
||||
(ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">|</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">|</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">|</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_bit_or<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_or</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">|</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">|</span></code> is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code> then instantiating <code class="computeroutput"><span class="identifier">has_bit_or</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code>
|
||||
will produce a compiler error. For this reason <code class="computeroutput"><span class="identifier">has_bit_or</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">|</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">|(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_or</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator|(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">|(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_or</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_or</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_and_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_or_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,150 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_bit_or_assign</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_bit_or.html" title="has_bit_or">
|
||||
<link rel="next" href="has_bit_xor.html" title="has_bit_xor">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_or.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_xor.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_bit_or_assign"></a><a class="link" href="has_bit_or_assign.html" title="has_bit_or_assign">has_bit_or_assign</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_bit_or_assign</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">|=</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">|=</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">|=</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">|=</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_bit_or_assign<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_or_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">|=</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">|=</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_bit_or_assign</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">|=</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">|=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator|=(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">|=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_or_assign</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_or.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_xor.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,148 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_bit_xor</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_bit_or_assign.html" title="has_bit_or_assign">
|
||||
<link rel="next" href="has_bit_xor_assign.html" title="has_bit_xor_assign">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_or_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_xor_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_bit_xor"></a><a class="link" href="has_bit_xor.html" title="has_bit_xor">has_bit_xor</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_bit_xor</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">^</span><span class="identifier">rhs</span></code>, and
|
||||
(ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">^</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">^</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">^</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_bit_xor<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_xor</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">^</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">^</span></code> is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code> then instantiating <code class="computeroutput"><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code>
|
||||
will produce a compiler error. For this reason <code class="computeroutput"><span class="identifier">has_bit_xor</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">^</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">^(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator^(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">^(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_xor</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_or_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_bit_xor_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,150 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_bit_xor_assign</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_bit_xor.html" title="has_bit_xor">
|
||||
<link rel="next" href="has_complement.html" title="has_complement">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_xor.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_complement.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_bit_xor_assign"></a><a class="link" href="has_bit_xor_assign.html" title="has_bit_xor_assign">has_bit_xor_assign</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_bit_xor_assign</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">^=</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">^=</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">^=</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">^=</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_bit_xor_assign<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_bit_xor_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">^=</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">^=</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_bit_xor_assign</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">^=</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">^=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator^=(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">^=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_bit_xor_assign</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_xor.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_complement.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,157 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_complement</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_bit_xor_assign.html" title="has_bit_xor_assign">
|
||||
<link rel="next" href="has_dereference.html" title="has_dereference">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_xor_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_dereference.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_complement"></a><a class="link" href="has_complement.html" title="has_complement">has_complement</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_complement</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">rhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Rhs</span></code> can be used in
|
||||
expression <code class="computeroutput"><span class="special">~</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="special">~</span><span class="identifier">rhs</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> then
|
||||
inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of prefix <code class="computeroutput"><span class="keyword">operator</span><span class="special">~</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(~</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_complement<Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_complement</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">long</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="keyword">int</span><span class="special">*></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">double</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether prefix <code class="computeroutput"><span class="keyword">operator</span><span class="special">~</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">~</span></code> is defined as a private member of <code class="computeroutput"><span class="identifier">Rhs</span></code> then instantiating <code class="computeroutput"><span class="identifier">has_complement</span><span class="special"><</span><span class="identifier">Rhs</span><span class="special">></span></code>
|
||||
will produce a compiler error. For this reason <code class="computeroutput"><span class="identifier">has_complement</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">~</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">~();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_complement</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator~() is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">~(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_complement</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_complement</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_bit_xor_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_dereference.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,166 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_dereference</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_complement.html" title="has_complement">
|
||||
<link rel="next" href="has_divides.html" title="has_divides">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_complement.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_divides.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_dereference"></a><a class="link" href="has_dereference.html" title="has_dereference">has_dereference</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_dereference</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">rhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Rhs</span></code> can be used in
|
||||
expression <code class="computeroutput"><span class="special">*</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="special">*</span><span class="identifier">rhs</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> then
|
||||
inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of prefix <code class="computeroutput"><span class="keyword">operator</span><span class="special">*</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(*</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_dereference<Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_dereference</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">int</span><span class="special">*>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">long</span><span class="special">*></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">const</span>
|
||||
<span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">int</span> <span class="keyword">const</span> <span class="special">*></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">int</span> <span class="special">*</span> <span class="keyword">const</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">int</span> <span class="keyword">const</span> <span class="special">*</span> <span class="keyword">const</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">void</span><span class="special">*></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">*,</span> <span class="keyword">int</span><span class="special">&></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether prefix <code class="computeroutput"><span class="keyword">operator</span><span class="special">*</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">*</span></code> is defined as a private member of <code class="computeroutput"><span class="identifier">Rhs</span></code> then instantiating <code class="computeroutput"><span class="identifier">has_dereference</span><span class="special"><</span><span class="identifier">Rhs</span><span class="special">></span></code>
|
||||
will produce a compiler error. For this reason <code class="computeroutput"><span class="identifier">has_dereference</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">*</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">*();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_dereference</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator*() is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_dereference</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_dereference</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_complement.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_divides.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,154 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_divides</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_dereference.html" title="has_dereference">
|
||||
<link rel="next" href="has_divides_assign.html" title="has_divides_assign">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_dereference.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_divides_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_divides"></a><a class="link" href="has_divides.html" title="has_divides">has_divides</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_divides</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">/</span><span class="identifier">rhs</span></code>, and
|
||||
(ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">/</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">/</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">/</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_divides<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_divides</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">double</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">/</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">/</span></code> is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code> then instantiating <code class="computeroutput"><span class="identifier">has_divides</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code>
|
||||
will produce a compiler error. For this reason <code class="computeroutput"><span class="identifier">has_divides</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">/</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_divides</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator/(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_divides</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_divides</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_dereference.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_divides_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,156 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_divides_assign</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_divides.html" title="has_divides">
|
||||
<link rel="next" href="has_equal_to.html" title="has_equal_to">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_divides.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_equal_to.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_divides_assign"></a><a class="link" href="has_divides_assign.html" title="has_divides_assign">has_divides_assign</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_divides_assign</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">/=</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">/=</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">/=</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">/=</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_divides_assign<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_divides_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">double</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">/=</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">/=</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_divides_assign</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">/=</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator/=(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_divides_assign</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_divides.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_equal_to.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,155 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_equal_to</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_divides_assign.html" title="has_divides_assign">
|
||||
<link rel="next" href="has_greater.html" title="has_greater">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_divides_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_greater.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_equal_to"></a><a class="link" href="has_equal_to.html" title="has_equal_to">has_equal_to</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_equal_to</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">==</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">==</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">==</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">==</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_equal_to<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_equal_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">double</span><span class="special">*></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">==</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">==</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_equal_to</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_equal_to</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">==</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_equal_to</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator==(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_equal_to</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_equal_to</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_divides_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_greater.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,155 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_greater</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_equal_to.html" title="has_equal_to">
|
||||
<link rel="next" href="has_greater_equal.html" title="has_greater_equal">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_equal_to.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_greater_equal.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_greater"></a><a class="link" href="has_greater.html" title="has_greater">has_greater</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_greater</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">></span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">></span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">></span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">></span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_greater<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_greater</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">double</span><span class="special">*></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">></span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">></span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_greater</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_greater</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">></span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">>(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_greater</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator>(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">>(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_greater</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_greater</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_equal_to.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_greater_equal.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,155 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_greater_equal</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_greater.html" title="has_greater">
|
||||
<link rel="next" href="has_left_shift.html" title="has_left_shift">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_greater.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_left_shift.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_greater_equal"></a><a class="link" href="has_greater_equal.html" title="has_greater_equal">has_greater_equal</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_greater_equal</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">>=</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">>=</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">>=</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_greater_equal<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_greater_equal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">double</span><span class="special">*></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_greater_equal</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator>=(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_greater_equal</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_greater.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_left_shift.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,162 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_left_shift</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_greater_equal.html" title="has_greater_equal">
|
||||
<link rel="next" href="has_left_shift_assign.html" title="has_left_shift_assign">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_greater_equal.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_left_shift_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_left_shift"></a><a class="link" href="has_left_shift.html" title="has_left_shift">has_left_shift</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_left_shift</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special"><<</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special"><<</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special"><<</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_left_shift<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_left_shift</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">,</span> <span class="keyword">char</span><span class="special">*,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_left_shift</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_left_shift</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special"><<(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_left_shift</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator<<(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special"><<(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_left_shift</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_left_shift</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_greater_equal.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_left_shift_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,150 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_left_shift_assign</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_left_shift.html" title="has_left_shift">
|
||||
<link rel="next" href="has_less.html" title="has_less">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_left_shift.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_less.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_left_shift_assign"></a><a class="link" href="has_left_shift_assign.html" title="has_left_shift_assign">has_left_shift_assign</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_left_shift_assign</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special"><<=</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special"><<=</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<=</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special"><<=</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_left_shift_assign<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_left_shift_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<=</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<=</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_left_shift_assign</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<=</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special"><<=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator<<=(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special"><<=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_left_shift_assign</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_left_shift.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_less.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,155 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_less</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_left_shift_assign.html" title="has_left_shift_assign">
|
||||
<link rel="next" href="has_less_equal.html" title="has_less_equal">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_left_shift_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_less_equal.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_less"></a><a class="link" href="has_less.html" title="has_less">has_less</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_less</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special"><</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special"><</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special"><</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special"><</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_less<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_less</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">double</span><span class="special">*></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special"><</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special"><</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_less</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_less</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special"><</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special"><(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_less</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator<(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special"><(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_less</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_less</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_left_shift_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_less_equal.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,155 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_less_equal</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_less.html" title="has_less">
|
||||
<link rel="next" href="has_logical_and.html" title="has_logical_and">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_less.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_logical_and.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_less_equal"></a><a class="link" href="has_less_equal.html" title="has_less_equal">has_less_equal</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_less_equal</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special"><=</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special"><=</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special"><=</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_less_equal<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_less_equal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">double</span><span class="special">*></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_less_equal</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_less_equal</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_less_equal</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator<=(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_less_equal</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_less_equal</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_less.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_logical_and.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,153 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_logical_and</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_less_equal.html" title="has_less_equal">
|
||||
<link rel="next" href="has_logical_not.html" title="has_logical_not">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_less_equal.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_logical_not.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_logical_and"></a><a class="link" href="has_logical_and.html" title="has_logical_and">has_logical_and</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_logical_and</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">&&</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">&&</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">&&</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">&&</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_logical_and<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_logical_and</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_and</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_and</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_and</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_and</span><span class="special"><</span><span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_and</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_and</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_and</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_and</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_and</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">&&</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">&&</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_logical_and</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_logical_and</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">&&</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">&&(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_and</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator&&(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">&&(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_and</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_and</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_less_equal.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_logical_not.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,153 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_logical_not</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_logical_and.html" title="has_logical_and">
|
||||
<link rel="next" href="has_logical_or.html" title="has_logical_or">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_logical_and.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_logical_or.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_logical_not"></a><a class="link" href="has_logical_not.html" title="has_logical_not">has_logical_not</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_logical_not</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">rhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Rhs</span></code> can be used in
|
||||
expression <code class="computeroutput"><span class="special">!</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="special">!</span><span class="identifier">rhs</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> then
|
||||
inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of prefix <code class="computeroutput"><span class="keyword">operator</span><span class="special">!</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(!</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_logical_not<Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_logical_not</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">long</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">double</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">bool</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether prefix <code class="computeroutput"><span class="keyword">operator</span><span class="special">!</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">!</span></code> is defined as a private member of <code class="computeroutput"><span class="identifier">Rhs</span></code> then instantiating <code class="computeroutput"><span class="identifier">has_logical_not</span><span class="special"><</span><span class="identifier">Rhs</span><span class="special">></span></code>
|
||||
will produce a compiler error. For this reason <code class="computeroutput"><span class="identifier">has_logical_not</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">!</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">!();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_not</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator!() is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">!(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_not</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_not</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_logical_and.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_logical_or.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,153 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_logical_or</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_logical_not.html" title="has_logical_not">
|
||||
<link rel="next" href="has_minus.html" title="has_minus">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_logical_not.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_minus.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_logical_or"></a><a class="link" href="has_logical_or.html" title="has_logical_or">has_logical_or</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_logical_or</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">||</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">||</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">||</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">||</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_logical_or<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_logical_or</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_or</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_or</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_or</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_or</span><span class="special"><</span><span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_or</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_or</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_or</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_or</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_logical_or</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">||</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">||</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_logical_or</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_logical_or</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">||</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">||(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_or</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator||(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">||(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_or</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_logical_or</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_logical_not.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_minus.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,154 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_minus</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_logical_or.html" title="has_logical_or">
|
||||
<link rel="next" href="has_minus_assign.html" title="has_minus_assign">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_logical_or.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_minus_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_minus"></a><a class="link" href="has_minus.html" title="has_minus">has_minus</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_minus</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">-</span><span class="identifier">rhs</span></code>, and
|
||||
(ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">-</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">-</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_minus<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_minus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">double</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code> is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code> then instantiating <code class="computeroutput"><span class="identifier">has_minus</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code>
|
||||
will produce a compiler error. For this reason <code class="computeroutput"><span class="identifier">has_minus</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_minus</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator-(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_minus</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_minus</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_logical_or.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_minus_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,156 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_minus_assign</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_minus.html" title="has_minus">
|
||||
<link rel="next" href="has_modulus.html" title="has_modulus">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_minus.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_modulus.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_minus_assign"></a><a class="link" href="has_minus_assign.html" title="has_minus_assign">has_minus_assign</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_minus_assign</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">-=</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">-=</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">-=</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_minus_assign<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_minus_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">double</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_minus_assign</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator-=(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_minus_assign</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_minus.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_modulus.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,147 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_modulus</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_minus_assign.html" title="has_minus_assign">
|
||||
<link rel="next" href="has_modulus_assign.html" title="has_modulus_assign">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_minus_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_modulus_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_modulus"></a><a class="link" href="has_modulus.html" title="has_modulus">has_modulus</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_modulus</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">%</span><span class="identifier">rhs</span></code>, and
|
||||
(ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">%</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">%</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_modulus<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_modulus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code> is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code> then instantiating <code class="computeroutput"><span class="identifier">has_modulus</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code>
|
||||
will produce a compiler error. For this reason <code class="computeroutput"><span class="identifier">has_modulus</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">%(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_modulus</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator%(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">%(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_modulus</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_modulus</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_minus_assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_modulus_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,149 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>has_modulus_assign</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="has_modulus.html" title="has_modulus">
|
||||
<link rel="next" href="has_multiplies.html" title="has_multiplies">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_modulus.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_multiplies.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.has_modulus_assign"></a><a class="link" href="has_modulus_assign.html" title="has_modulus_assign">has_modulus_assign</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rhs</span><span class="special">=</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">has_modulus_assign</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Inherits:</strong></span> If (i) <code class="computeroutput"><span class="identifier">lhs</span></code>
|
||||
of type <code class="computeroutput"><span class="identifier">Lhs</span></code> and <code class="computeroutput"><span class="identifier">rhs</span></code> of type <code class="computeroutput"><span class="identifier">Rhs</span></code>
|
||||
can be used in expression <code class="computeroutput"><span class="identifier">lhs</span><span class="special">%=</span><span class="identifier">rhs</span></code>,
|
||||
and (ii) <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code> or the result of expression
|
||||
<code class="computeroutput"><span class="identifier">lhs</span><span class="special">%=</span><span class="identifier">rhs</span></code> is convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
The default behaviour (<code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="identifier">dont_care</span></code>)
|
||||
is to not check for the return value of binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=</span></code>. If <code class="computeroutput"><span class="identifier">Ret</span></code>
|
||||
is different from the default <code class="computeroutput"><span class="identifier">dont_care</span></code>
|
||||
type, the return value is checked to be convertible to <code class="computeroutput"><span class="identifier">Ret</span></code>.
|
||||
Convertible to <code class="computeroutput"><span class="identifier">Ret</span></code> means
|
||||
that the return value of the operator can be used as argument to a function
|
||||
expecting <code class="computeroutput"><span class="identifier">Ret</span></code>:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">Ret</span><span class="special">);</span>
|
||||
<span class="identifier">Lhs</span> <span class="identifier">lhs</span><span class="special">;</span>
|
||||
<span class="identifier">Rhs</span> <span class="identifier">rhs</span><span class="special">;</span>
|
||||
<span class="identifier">f</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">%=</span><span class="identifier">rhs</span><span class="special">);</span> <span class="comment">// is valid if has_modulus_assign<Lhs, Rhs, Ret>::value==true</span>
|
||||
</pre>
|
||||
<p>
|
||||
If <code class="computeroutput"><span class="identifier">Ret</span><span class="special">=</span><span class="keyword">void</span></code>, the return type is checked to be exactly
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_modulus_assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_operator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">,</span> <span class="identifier">Rhs</span><span class="special">,</span> <span class="identifier">Ret</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> is a <code class="computeroutput"><span class="keyword">bool</span></code>
|
||||
integral constant expression that evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">long</span><span class="special">></span></code>
|
||||
inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>::</span><span class="identifier">value</span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<code class="computeroutput"><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code>.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
<span class="bold"><strong>See also:</strong></span> <a class="link" href="../category/value_traits/operators.html" title="Operator Type Traits">Operator
|
||||
Type Traits</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Known issues:</strong></span>
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
This trait cannot detect whether binary <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=</span></code> is public or not: if <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=</span></code>
|
||||
is defined as a private member of <code class="computeroutput"><span class="identifier">Lhs</span></code>
|
||||
then instantiating <code class="computeroutput"><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="identifier">Lhs</span><span class="special">></span></code> will produce a compiler error. For
|
||||
this reason <code class="computeroutput"><span class="identifier">has_modulus_assign</span></code>
|
||||
cannot be used to determine whether a type has a public <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=</span></code>
|
||||
or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator%=(const A&) is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// this is fine</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_modulus_assign</span><span class="special"><</span><span class="identifier">B</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: ambiguous overload</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="keyword">volatile</span></code> qualifier is not
|
||||
properly handled and would lead to undefined behavior
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="has_modulus.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_multiplies.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user