mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Improved empty_base
[SVN r37754]
This commit is contained in:
parent
2d860e2574
commit
06404f7d39
@ -8,6 +8,8 @@
|
|||||||
// See http://www.boost.org/libs/utility/operators.htm for documentation.
|
// See http://www.boost.org/libs/utility/operators.htm for documentation.
|
||||||
|
|
||||||
// Revision History
|
// Revision History
|
||||||
|
// 24 May 07 Changed empty_base to depend on T, see
|
||||||
|
// http://svn.boost.org/trac/boost/ticket/979
|
||||||
// 21 Oct 02 Modified implementation of operators to allow compilers with a
|
// 21 Oct 02 Modified implementation of operators to allow compilers with a
|
||||||
// correct named return value optimization (NRVO) to produce optimal
|
// correct named return value optimization (NRVO) to produce optimal
|
||||||
// code. (Daniel Frey)
|
// code. (Daniel Frey)
|
||||||
@ -90,15 +92,15 @@
|
|||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
|
template <typename T> class empty_base {
|
||||||
|
|
||||||
// Helmut Zeisel, empty base class optimization bug with GCC 3.0.0
|
// Helmut Zeisel, empty base class optimization bug with GCC 3.0.0
|
||||||
#if defined(__GNUC__) && __GNUC__==3 && __GNUC_MINOR__==0 && __GNU_PATCHLEVEL__==0
|
#if defined(__GNUC__) && __GNUC__==3 && __GNUC_MINOR__==0 && __GNU_PATCHLEVEL__==0
|
||||||
class empty_base {
|
|
||||||
bool dummy;
|
bool dummy;
|
||||||
};
|
|
||||||
#else
|
|
||||||
class empty_base {};
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
@ -119,7 +121,7 @@ namespace boost
|
|||||||
// Note that friend functions defined in a class are implicitly inline.
|
// Note that friend functions defined in a class are implicitly inline.
|
||||||
// See the C++ std, 11.4 [class.friend] paragraph 5
|
// See the C++ std, 11.4 [class.friend] paragraph 5
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct less_than_comparable2 : B
|
struct less_than_comparable2 : B
|
||||||
{
|
{
|
||||||
friend bool operator<=(const T& x, const U& y) { return !(x > y); }
|
friend bool operator<=(const T& x, const U& y) { return !(x > y); }
|
||||||
@ -130,7 +132,7 @@ struct less_than_comparable2 : B
|
|||||||
friend bool operator>=(const U& x, const T& y) { return !(y > x); }
|
friend bool operator>=(const U& x, const T& y) { return !(y > x); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct less_than_comparable1 : B
|
struct less_than_comparable1 : B
|
||||||
{
|
{
|
||||||
friend bool operator>(const T& x, const T& y) { return y < x; }
|
friend bool operator>(const T& x, const T& y) { return y < x; }
|
||||||
@ -138,7 +140,7 @@ struct less_than_comparable1 : B
|
|||||||
friend bool operator>=(const T& x, const T& y) { return !(x < y); }
|
friend bool operator>=(const T& x, const T& y) { return !(x < y); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct equality_comparable2 : B
|
struct equality_comparable2 : B
|
||||||
{
|
{
|
||||||
friend bool operator==(const U& y, const T& x) { return x == y; }
|
friend bool operator==(const U& y, const T& x) { return x == y; }
|
||||||
@ -146,7 +148,7 @@ struct equality_comparable2 : B
|
|||||||
friend bool operator!=(const T& y, const U& x) { return !(y == x); }
|
friend bool operator!=(const T& y, const U& x) { return !(y == x); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct equality_comparable1 : B
|
struct equality_comparable1 : B
|
||||||
{
|
{
|
||||||
friend bool operator!=(const T& x, const T& y) { return !(x == y); }
|
friend bool operator!=(const T& x, const T& y) { return !(x == y); }
|
||||||
@ -165,7 +167,7 @@ struct equality_comparable1 : B
|
|||||||
// implementation available.
|
// implementation available.
|
||||||
|
|
||||||
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
|
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##2 : B \
|
struct NAME##2 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( const T& lhs, const U& rhs ) \
|
friend T operator OP( const T& lhs, const U& rhs ) \
|
||||||
@ -174,33 +176,33 @@ struct NAME##2 : B \
|
|||||||
{ T nrv( rhs ); nrv OP##= lhs; return nrv; } \
|
{ T nrv( rhs ); nrv OP##= lhs; return nrv; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class B = ::boost::detail::empty_base> \
|
template <class T, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##1 : B \
|
struct NAME##1 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( const T& lhs, const T& rhs ) \
|
friend T operator OP( const T& lhs, const T& rhs ) \
|
||||||
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
|
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
|
#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##2 : B \
|
struct NAME##2 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( const T& lhs, const U& rhs ) \
|
friend T operator OP( const T& lhs, const U& rhs ) \
|
||||||
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
|
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct BOOST_OPERATOR2_LEFT(NAME) : B \
|
struct BOOST_OPERATOR2_LEFT(NAME) : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( const U& lhs, const T& rhs ) \
|
friend T operator OP( const U& lhs, const T& rhs ) \
|
||||||
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
|
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class B = ::boost::detail::empty_base> \
|
template <class T, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##1 : B \
|
struct NAME##1 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( const T& lhs, const T& rhs ) \
|
friend T operator OP( const T& lhs, const T& rhs ) \
|
||||||
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
|
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
|
||||||
};
|
};
|
||||||
|
|
||||||
#else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
|
#else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
|
||||||
@ -210,35 +212,35 @@ struct NAME##1 : B \
|
|||||||
// BOOST_OPERATOR2_LEFT(NAME) only looks cool, but doesn't provide
|
// BOOST_OPERATOR2_LEFT(NAME) only looks cool, but doesn't provide
|
||||||
// optimization opportunities to the compiler :)
|
// optimization opportunities to the compiler :)
|
||||||
|
|
||||||
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
|
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##2 : B \
|
struct NAME##2 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
||||||
friend T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \
|
friend T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class B = ::boost::detail::empty_base> \
|
template <class T, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##1 : B \
|
struct NAME##1 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
|
#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##2 : B \
|
struct NAME##2 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct BOOST_OPERATOR2_LEFT(NAME) : B \
|
struct BOOST_OPERATOR2_LEFT(NAME) : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( const U& lhs, const T& rhs ) \
|
friend T operator OP( const U& lhs, const T& rhs ) \
|
||||||
{ return T( lhs ) OP##= rhs; } \
|
{ return T( lhs ) OP##= rhs; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class B = ::boost::detail::empty_base> \
|
template <class T, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##1 : B \
|
struct NAME##1 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
||||||
@ -261,7 +263,7 @@ BOOST_BINARY_OPERATOR_COMMUTATIVE( orable, | )
|
|||||||
|
|
||||||
// incrementable and decrementable contributed by Jeremy Siek
|
// incrementable and decrementable contributed by Jeremy Siek
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct incrementable : B
|
struct incrementable : B
|
||||||
{
|
{
|
||||||
friend T operator++(T& x, int)
|
friend T operator++(T& x, int)
|
||||||
@ -274,7 +276,7 @@ private: // The use of this typedef works around a Borland bug
|
|||||||
typedef T incrementable_type;
|
typedef T incrementable_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct decrementable : B
|
struct decrementable : B
|
||||||
{
|
{
|
||||||
friend T operator--(T& x, int)
|
friend T operator--(T& x, int)
|
||||||
@ -289,7 +291,7 @@ private: // The use of this typedef works around a Borland bug
|
|||||||
|
|
||||||
// Iterator operator classes (contributed by Jeremy Siek) ------------------//
|
// Iterator operator classes (contributed by Jeremy Siek) ------------------//
|
||||||
|
|
||||||
template <class T, class P, class B = ::boost::detail::empty_base>
|
template <class T, class P, class B = ::boost::detail::empty_base<T> >
|
||||||
struct dereferenceable : B
|
struct dereferenceable : B
|
||||||
{
|
{
|
||||||
P operator->() const
|
P operator->() const
|
||||||
@ -298,7 +300,7 @@ struct dereferenceable : B
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class I, class R, class B = ::boost::detail::empty_base>
|
template <class T, class I, class R, class B = ::boost::detail::empty_base<T> >
|
||||||
struct indexable : B
|
struct indexable : B
|
||||||
{
|
{
|
||||||
R operator[](I n) const
|
R operator[](I n) const
|
||||||
@ -313,14 +315,14 @@ struct indexable : B
|
|||||||
#if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
|
#if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
|
||||||
|
|
||||||
#define BOOST_BINARY_OPERATOR( NAME, OP ) \
|
#define BOOST_BINARY_OPERATOR( NAME, OP ) \
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##2 : B \
|
struct NAME##2 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( const T& lhs, const U& rhs ) \
|
friend T operator OP( const T& lhs, const U& rhs ) \
|
||||||
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
|
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class B = ::boost::detail::empty_base> \
|
template <class T, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##1 : B \
|
struct NAME##1 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( const T& lhs, const T& rhs ) \
|
friend T operator OP( const T& lhs, const T& rhs ) \
|
||||||
@ -330,13 +332,13 @@ struct NAME##1 : B \
|
|||||||
#else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
|
#else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
|
||||||
|
|
||||||
#define BOOST_BINARY_OPERATOR( NAME, OP ) \
|
#define BOOST_BINARY_OPERATOR( NAME, OP ) \
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##2 : B \
|
struct NAME##2 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class B = ::boost::detail::empty_base> \
|
template <class T, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct NAME##1 : B \
|
struct NAME##1 : B \
|
||||||
{ \
|
{ \
|
||||||
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
||||||
@ -349,7 +351,7 @@ BOOST_BINARY_OPERATOR( right_shiftable, >> )
|
|||||||
|
|
||||||
#undef BOOST_BINARY_OPERATOR
|
#undef BOOST_BINARY_OPERATOR
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct equivalent2 : B
|
struct equivalent2 : B
|
||||||
{
|
{
|
||||||
friend bool operator==(const T& x, const U& y)
|
friend bool operator==(const T& x, const U& y)
|
||||||
@ -358,7 +360,7 @@ struct equivalent2 : B
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct equivalent1 : B
|
struct equivalent1 : B
|
||||||
{
|
{
|
||||||
friend bool operator==(const T&x, const T&y)
|
friend bool operator==(const T&x, const T&y)
|
||||||
@ -367,7 +369,7 @@ struct equivalent1 : B
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct partially_ordered2 : B
|
struct partially_ordered2 : B
|
||||||
{
|
{
|
||||||
friend bool operator<=(const T& x, const U& y)
|
friend bool operator<=(const T& x, const U& y)
|
||||||
@ -384,7 +386,7 @@ struct partially_ordered2 : B
|
|||||||
{ return (y < x) || (y == x); }
|
{ return (y < x) || (y == x); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct partially_ordered1 : B
|
struct partially_ordered1 : B
|
||||||
{
|
{
|
||||||
friend bool operator>(const T& x, const T& y)
|
friend bool operator>(const T& x, const T& y)
|
||||||
@ -397,161 +399,161 @@ struct partially_ordered1 : B
|
|||||||
|
|
||||||
// Combined operator classes (contributed by Daryle Walker) ----------------//
|
// Combined operator classes (contributed by Daryle Walker) ----------------//
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct totally_ordered2
|
struct totally_ordered2
|
||||||
: less_than_comparable2<T, U
|
: less_than_comparable2<T, U
|
||||||
, equality_comparable2<T, U, B
|
, equality_comparable2<T, U, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct totally_ordered1
|
struct totally_ordered1
|
||||||
: less_than_comparable1<T
|
: less_than_comparable1<T
|
||||||
, equality_comparable1<T, B
|
, equality_comparable1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct additive2
|
struct additive2
|
||||||
: addable2<T, U
|
: addable2<T, U
|
||||||
, subtractable2<T, U, B
|
, subtractable2<T, U, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct additive1
|
struct additive1
|
||||||
: addable1<T
|
: addable1<T
|
||||||
, subtractable1<T, B
|
, subtractable1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct multiplicative2
|
struct multiplicative2
|
||||||
: multipliable2<T, U
|
: multipliable2<T, U
|
||||||
, dividable2<T, U, B
|
, dividable2<T, U, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct multiplicative1
|
struct multiplicative1
|
||||||
: multipliable1<T
|
: multipliable1<T
|
||||||
, dividable1<T, B
|
, dividable1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct integer_multiplicative2
|
struct integer_multiplicative2
|
||||||
: multiplicative2<T, U
|
: multiplicative2<T, U
|
||||||
, modable2<T, U, B
|
, modable2<T, U, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct integer_multiplicative1
|
struct integer_multiplicative1
|
||||||
: multiplicative1<T
|
: multiplicative1<T
|
||||||
, modable1<T, B
|
, modable1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct arithmetic2
|
struct arithmetic2
|
||||||
: additive2<T, U
|
: additive2<T, U
|
||||||
, multiplicative2<T, U, B
|
, multiplicative2<T, U, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct arithmetic1
|
struct arithmetic1
|
||||||
: additive1<T
|
: additive1<T
|
||||||
, multiplicative1<T, B
|
, multiplicative1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct integer_arithmetic2
|
struct integer_arithmetic2
|
||||||
: additive2<T, U
|
: additive2<T, U
|
||||||
, integer_multiplicative2<T, U, B
|
, integer_multiplicative2<T, U, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct integer_arithmetic1
|
struct integer_arithmetic1
|
||||||
: additive1<T
|
: additive1<T
|
||||||
, integer_multiplicative1<T, B
|
, integer_multiplicative1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct bitwise2
|
struct bitwise2
|
||||||
: xorable2<T, U
|
: xorable2<T, U
|
||||||
, andable2<T, U
|
, andable2<T, U
|
||||||
, orable2<T, U, B
|
, orable2<T, U, B
|
||||||
> > > {};
|
> > > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct bitwise1
|
struct bitwise1
|
||||||
: xorable1<T
|
: xorable1<T
|
||||||
, andable1<T
|
, andable1<T
|
||||||
, orable1<T, B
|
, orable1<T, B
|
||||||
> > > {};
|
> > > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct unit_steppable
|
struct unit_steppable
|
||||||
: incrementable<T
|
: incrementable<T
|
||||||
, decrementable<T, B
|
, decrementable<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct shiftable2
|
struct shiftable2
|
||||||
: left_shiftable2<T, U
|
: left_shiftable2<T, U
|
||||||
, right_shiftable2<T, U, B
|
, right_shiftable2<T, U, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct shiftable1
|
struct shiftable1
|
||||||
: left_shiftable1<T
|
: left_shiftable1<T
|
||||||
, right_shiftable1<T, B
|
, right_shiftable1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct ring_operators2
|
struct ring_operators2
|
||||||
: additive2<T, U
|
: additive2<T, U
|
||||||
, subtractable2_left<T, U
|
, subtractable2_left<T, U
|
||||||
, multipliable2<T, U, B
|
, multipliable2<T, U, B
|
||||||
> > > {};
|
> > > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct ring_operators1
|
struct ring_operators1
|
||||||
: additive1<T
|
: additive1<T
|
||||||
, multipliable1<T, B
|
, multipliable1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct ordered_ring_operators2
|
struct ordered_ring_operators2
|
||||||
: ring_operators2<T, U
|
: ring_operators2<T, U
|
||||||
, totally_ordered2<T, U, B
|
, totally_ordered2<T, U, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct ordered_ring_operators1
|
struct ordered_ring_operators1
|
||||||
: ring_operators1<T
|
: ring_operators1<T
|
||||||
, totally_ordered1<T, B
|
, totally_ordered1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct field_operators2
|
struct field_operators2
|
||||||
: ring_operators2<T, U
|
: ring_operators2<T, U
|
||||||
, dividable2<T, U
|
, dividable2<T, U
|
||||||
, dividable2_left<T, U, B
|
, dividable2_left<T, U, B
|
||||||
> > > {};
|
> > > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct field_operators1
|
struct field_operators1
|
||||||
: ring_operators1<T
|
: ring_operators1<T
|
||||||
, dividable1<T, B
|
, dividable1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct ordered_field_operators2
|
struct ordered_field_operators2
|
||||||
: field_operators2<T, U
|
: field_operators2<T, U
|
||||||
, totally_ordered2<T, U, B
|
, totally_ordered2<T, U, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct ordered_field_operators1
|
struct ordered_field_operators1
|
||||||
: field_operators1<T
|
: field_operators1<T
|
||||||
, totally_ordered1<T, B
|
, totally_ordered1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct euclidian_ring_operators2
|
struct euclidian_ring_operators2
|
||||||
: ring_operators2<T, U
|
: ring_operators2<T, U
|
||||||
, dividable2<T, U
|
, dividable2<T, U
|
||||||
@ -560,43 +562,43 @@ struct euclidian_ring_operators2
|
|||||||
, modable2_left<T, U, B
|
, modable2_left<T, U, B
|
||||||
> > > > > {};
|
> > > > > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct euclidian_ring_operators1
|
struct euclidian_ring_operators1
|
||||||
: ring_operators1<T
|
: ring_operators1<T
|
||||||
, dividable1<T
|
, dividable1<T
|
||||||
, modable1<T, B
|
, modable1<T, B
|
||||||
> > > {};
|
> > > {};
|
||||||
|
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base>
|
template <class T, class U, class B = ::boost::detail::empty_base<T> >
|
||||||
struct ordered_euclidian_ring_operators2
|
struct ordered_euclidian_ring_operators2
|
||||||
: totally_ordered2<T, U
|
: totally_ordered2<T, U
|
||||||
, euclidian_ring_operators2<T, U, B
|
, euclidian_ring_operators2<T, U, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct ordered_euclidian_ring_operators1
|
struct ordered_euclidian_ring_operators1
|
||||||
: totally_ordered1<T
|
: totally_ordered1<T
|
||||||
, euclidian_ring_operators1<T, B
|
, euclidian_ring_operators1<T, B
|
||||||
> > {};
|
> > {};
|
||||||
|
|
||||||
template <class T, class P, class B = ::boost::detail::empty_base>
|
template <class T, class P, class B = ::boost::detail::empty_base<T> >
|
||||||
struct input_iteratable
|
struct input_iteratable
|
||||||
: equality_comparable1<T
|
: equality_comparable1<T
|
||||||
, incrementable<T
|
, incrementable<T
|
||||||
, dereferenceable<T, P, B
|
, dereferenceable<T, P, B
|
||||||
> > > {};
|
> > > {};
|
||||||
|
|
||||||
template <class T, class B = ::boost::detail::empty_base>
|
template <class T, class B = ::boost::detail::empty_base<T> >
|
||||||
struct output_iteratable
|
struct output_iteratable
|
||||||
: incrementable<T, B
|
: incrementable<T, B
|
||||||
> {};
|
> {};
|
||||||
|
|
||||||
template <class T, class P, class B = ::boost::detail::empty_base>
|
template <class T, class P, class B = ::boost::detail::empty_base<T> >
|
||||||
struct forward_iteratable
|
struct forward_iteratable
|
||||||
: input_iteratable<T, P, B
|
: input_iteratable<T, P, B
|
||||||
> {};
|
> {};
|
||||||
|
|
||||||
template <class T, class P, class B = ::boost::detail::empty_base>
|
template <class T, class P, class B = ::boost::detail::empty_base<T> >
|
||||||
struct bidirectional_iteratable
|
struct bidirectional_iteratable
|
||||||
: forward_iteratable<T, P
|
: forward_iteratable<T, P
|
||||||
, decrementable<T, B
|
, decrementable<T, B
|
||||||
@ -606,7 +608,7 @@ struct bidirectional_iteratable
|
|||||||
// which is an indirect base class of bidirectional_iterable,
|
// which is an indirect base class of bidirectional_iterable,
|
||||||
// random_access_iteratable must not be derived from totally_ordered1
|
// random_access_iteratable must not be derived from totally_ordered1
|
||||||
// but from less_than_comparable1 only. (Helmut Zeisel, 02-Dec-2001)
|
// but from less_than_comparable1 only. (Helmut Zeisel, 02-Dec-2001)
|
||||||
template <class T, class P, class D, class R, class B = ::boost::detail::empty_base>
|
template <class T, class P, class D, class R, class B = ::boost::detail::empty_base<T> >
|
||||||
struct random_access_iteratable
|
struct random_access_iteratable
|
||||||
: bidirectional_iteratable<T, P
|
: bidirectional_iteratable<T, P
|
||||||
, less_than_comparable1<T
|
, less_than_comparable1<T
|
||||||
@ -650,20 +652,20 @@ struct random_access_iteratable
|
|||||||
|
|
||||||
// Otherwise, because a Borland C++ 5.5 bug prevents a using declaration
|
// Otherwise, because a Borland C++ 5.5 bug prevents a using declaration
|
||||||
// from working, we are forced to use inheritance for that compiler.
|
// from working, we are forced to use inheritance for that compiler.
|
||||||
# define BOOST_IMPORT_TEMPLATE4(template_name) \
|
# define BOOST_IMPORT_TEMPLATE4(template_name) \
|
||||||
template <class T, class U, class V, class W, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class V, class W, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct template_name : ::template_name<T, U, V, W, B> {};
|
struct template_name : ::template_name<T, U, V, W, B> {};
|
||||||
|
|
||||||
# define BOOST_IMPORT_TEMPLATE3(template_name) \
|
# define BOOST_IMPORT_TEMPLATE3(template_name) \
|
||||||
template <class T, class U, class V, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class V, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct template_name : ::template_name<T, U, V, B> {};
|
struct template_name : ::template_name<T, U, V, B> {};
|
||||||
|
|
||||||
# define BOOST_IMPORT_TEMPLATE2(template_name) \
|
# define BOOST_IMPORT_TEMPLATE2(template_name) \
|
||||||
template <class T, class U, class B = ::boost::detail::empty_base> \
|
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct template_name : ::template_name<T, U, B> {};
|
struct template_name : ::template_name<T, U, B> {};
|
||||||
|
|
||||||
# define BOOST_IMPORT_TEMPLATE1(template_name) \
|
# define BOOST_IMPORT_TEMPLATE1(template_name) \
|
||||||
template <class T, class B = ::boost::detail::empty_base> \
|
template <class T, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct template_name : ::template_name<T, B> {};
|
struct template_name : ::template_name<T, B> {};
|
||||||
|
|
||||||
# endif // BOOST_NO_USING_TEMPLATE
|
# endif // BOOST_NO_USING_TEMPLATE
|
||||||
@ -752,7 +754,7 @@ template<class T> struct is_chained_base {
|
|||||||
# define BOOST_OPERATOR_TEMPLATE(template_name) \
|
# define BOOST_OPERATOR_TEMPLATE(template_name) \
|
||||||
template <class T \
|
template <class T \
|
||||||
,class U = T \
|
,class U = T \
|
||||||
,class B = ::boost::detail::empty_base \
|
,class B = ::boost::detail::empty_base<T> \
|
||||||
,class O = typename is_chained_base<U>::value \
|
,class O = typename is_chained_base<U>::value \
|
||||||
> \
|
> \
|
||||||
struct template_name : template_name##2<T, U, B> {}; \
|
struct template_name : template_name##2<T, U, B> {}; \
|
||||||
@ -788,7 +790,7 @@ BOOST_OPERATOR_TEMPLATE1(template_name##1)
|
|||||||
// In this case we can only assume that template_name<> is equivalent to the
|
// In this case we can only assume that template_name<> is equivalent to the
|
||||||
// more commonly needed template_name1<> form.
|
// more commonly needed template_name1<> form.
|
||||||
# define BOOST_OPERATOR_TEMPLATE(template_name) \
|
# define BOOST_OPERATOR_TEMPLATE(template_name) \
|
||||||
template <class T, class B = ::boost::detail::empty_base> \
|
template <class T, class B = ::boost::detail::empty_base<T> > \
|
||||||
struct template_name : template_name##1<T, B> {};
|
struct template_name : template_name##1<T, B> {};
|
||||||
|
|
||||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||||
|
Loading…
x
Reference in New Issue
Block a user