/usr/include/boost
NameSizeModeActions
accumulators/-0755rm
algorithm/-0755rm
align/-0755rm
archive/-0755rm
asio/-0755rm
assert/-0755rm
assign/-0755rm
atomic/-0755rm
beast/-0755rm
bimap/-0755rm
bind/-0755rm
callable_traits/-0755rm
chrono/-0755rm
circular_buffer/-0755rm
compatibility/-0755rm
compute/-0755rm
concept/-0755rm
concept_check/-0755rm
config/-0755rm
container/-0755rm
container_hash/-0755rm
context/-0755rm
contract/-0755rm
convert/-0755rm
core/-0755rm
coroutine/-0755rm
coroutine2/-0755rm
date_time/-0755rm
detail/-0755rm
dll/-0755rm
dynamic_bitset/-0755rm
endian/-0755rm
exception/-0755rm
fiber/-0755rm
filesystem/-0755rm
flyweight/-0755rm
format/-0755rm
function/-0755rm
functional/-0755rm
function_types/-0755rm
fusion/-0755rm
geometry/-0755rm
gil/-0755rm
graph/-0755rm
hana/-0755rm
heap/-0755rm
histogram/-0755rm
hof/-0755rm
icl/-0755rm
integer/-0755rm
interprocess/-0755rm
intrusive/-0755rm
io/-0755rm
iostreams/-0755rm
iterator/-0755rm
lambda/-0755rm
lexical_cast/-0755rm
locale/-0755rm
local_function/-0755rm
lockfree/-0755rm
log/-0755rm
logic/-0755rm
math/-0755rm
metaparse/-0755rm
move/-0755rm
mp11/-0755rm
mpi/-0755rm
mpl/-0755rm
msm/-0755rm
multiprecision/-0755rm
multi_array/-0755rm
multi_index/-0755rm
nowide/-0755rm
numeric/-0755rm
optional/-0755rm
outcome/-0755rm
parameter/-0755rm
pending/-0755rm
phoenix/-0755rm
polygon/-0755rm
poly_collection/-0755rm
pool/-0755rm
predef/-0755rm
preprocessor/-0755rm
process/-0755rm
program_options/-0755rm
property_map/-0755rm
property_tree/-0755rm
proto/-0755rm
ptr_container/-0755rm
python/-0755rm
qvm/-0755rm
random/-0755rm
range/-0755rm
ratio/-0755rm
regex/-0755rm
safe_numerics/-0755rm
serialization/-0755rm
signals2/-0755rm
smart_ptr/-0755rm
sort/-0755rm
spirit/-0755rm
stacktrace/-0755rm
statechart/-0755rm
static_string/-0755rm
stl_interfaces/-0755rm
system/-0755rm
test/-0755rm
thread/-0755rm
timer/-0755rm
tti/-0755rm
tuple/-0755rm
typeof/-0755rm
type_erasure/-0755rm
type_index/-0755rm
type_traits/-0755rm
units/-0755rm
unordered/-0755rm
utility/-0755rm
uuid/-0755rm
variant/-0755rm
variant2/-0755rm
vmd/-0755rm
wave/-0755rm
winapi/-0755rm
xpressive/-0755rm
yap/-0755rm
align.hpp6330644editdlrm
aligned_storage.hpp6530644editdlrm
any.hpp94720644editdlrm
array.hpp158270644editdlrm
asio.hpp74720644editdlrm
assert.hpp26250644editdlrm
assign.hpp5920644editdlrm
atomic.hpp7540644editdlrm
beast.hpp5910644editdlrm
bimap.hpp3870644editdlrm
bind.hpp18090644editdlrm
blank.hpp19850644editdlrm
blank_fwd.hpp6180644editdlrm
callable_traits.hpp21380644editdlrm
call_traits.hpp6330644editdlrm
cast.hpp5840644editdlrm
cerrno.hpp41870644editdlrm
checked_delete.hpp4140644editdlrm
chrono.hpp7060644editdlrm
circular_buffer.hpp19460644editdlrm
circular_buffer_fwd.hpp11370644editdlrm
compressed_pair.hpp6530644editdlrm
compute.hpp15230644editdlrm
concept_archetype.hpp237250644editdlrm
concept_check.hpp319770644editdlrm
config.hpp22160644editdlrm
contract.hpp18420644editdlrm
contract_macro.hpp564970644editdlrm
convert.hpp74020644editdlrm
crc.hpp948830644editdlrm
cregex.hpp7210644editdlrm
cstdfloat.hpp26110644editdlrm
cstdint.hpp184970644editdlrm
cstdlib.hpp17390644editdlrm
current_function.hpp16810644editdlrm
cxx11_char_types.hpp41600644editdlrm
date_time.hpp5400644editdlrm
dll.hpp7120644editdlrm
dynamic_bitset.hpp5600644editdlrm
dynamic_bitset_fwd.hpp6750644editdlrm
enable_shared_from_this.hpp5250644editdlrm
endian.hpp3640644editdlrm
exception_ptr.hpp3960644editdlrm
filesystem.hpp8620644editdlrm
flyweight.hpp6040644editdlrm
foreach.hpp455510644editdlrm
foreach_fwd.hpp17020644editdlrm
format.hpp21790644editdlrm
function.hpp25240644editdlrm
functional.hpp201240644editdlrm
function_equal.hpp7910644editdlrm
function_output_iterator.hpp6300644editdlrm
generator_iterator.hpp20280644editdlrm
geometry.hpp7040644editdlrm
get_pointer.hpp22880644editdlrm
gil.hpp16970644editdlrm
hana.hpp68070644editdlrm
histogram.hpp13120644editdlrm
hof.hpp20090644editdlrm
implicit_cast.hpp8100644editdlrm
indirect_reference.hpp10360644editdlrm
integer.hpp115930644editdlrm
integer_fwd.hpp51810644editdlrm
integer_traits.hpp83190644editdlrm
intrusive_ptr.hpp4810644editdlrm
io_fwd.hpp18790644editdlrm
is_placeholder.hpp6340644editdlrm
iterator.hpp4590644editdlrm
iterator_adaptors.hpp4660644editdlrm
lexical_cast.hpp32750644editdlrm
limits.hpp61560644editdlrm
locale.hpp8870644editdlrm
local_function.hpp188580644editdlrm
make_default.hpp15100644editdlrm
make_shared.hpp4640644editdlrm
make_unique.hpp2930644editdlrm
math_fwd.hpp9750644editdlrm
memory_order.hpp24570644editdlrm
mem_fn.hpp5960644editdlrm
metaparse.hpp52810644editdlrm
mp11.hpp6410644editdlrm
mpi.hpp11010644editdlrm
multi_array.hpp180210644editdlrm
multi_index_container.hpp449830644editdlrm
multi_index_container_fwd.hpp37760644editdlrm
next_prior.hpp51270644editdlrm
noncopyable.hpp4020644editdlrm
nondet_random.hpp5320644editdlrm
none.hpp16090644editdlrm
none_t.hpp9530644editdlrm
non_type.hpp6190644editdlrm
operators.hpp365740644editdlrm
operators_v1.hpp377350644editdlrm
optional.hpp5280644editdlrm
outcome.hpp16990644editdlrm
parameter.hpp10820644editdlrm
phoenix.hpp4760644editdlrm
pointee.hpp18070644editdlrm
pointer_cast.hpp36880644editdlrm
pointer_to_other.hpp11970644editdlrm
polymorphic_cast.hpp52820644editdlrm
polymorphic_pointer_cast.hpp28290644editdlrm
predef.h6350644editdlrm
preprocessor.hpp4870644editdlrm
process.hpp13660644editdlrm
program_options.hpp8200644editdlrm
progress.hpp57340644editdlrm
python.hpp29500644editdlrm
random.hpp38540644editdlrm
range.hpp6030644editdlrm
ratio.hpp3490644editdlrm
rational.hpp397200644editdlrm
ref.hpp3700644editdlrm
regex.h21740644editdlrm
regex.hpp8230644editdlrm
regex_fwd.hpp6930644editdlrm
scoped_array.hpp5060644editdlrm
scoped_ptr.hpp4970644editdlrm
scope_exit.hpp547450644editdlrm
shared_array.hpp5360644editdlrm
shared_container_iterator.hpp21540644editdlrm
shared_ptr.hpp5250644editdlrm
signals2.hpp7520644editdlrm
smart_ptr.hpp7800644editdlrm
spirit.hpp11330644editdlrm
stacktrace.hpp4990644editdlrm
static_assert.hpp72130644editdlrm
static_string.hpp4230644editdlrm
swap.hpp3740644editdlrm
thread.hpp8390644editdlrm
throw_exception.hpp43280644editdlrm
timer.hpp27810644editdlrm
tokenizer.hpp27830644editdlrm
token_functions.hpp193490644editdlrm
token_iterator.hpp38100644editdlrm
type.hpp4810644editdlrm
type_index.hpp107570644editdlrm
type_traits.hpp74310644editdlrm
unordered_map.hpp5680644editdlrm
unordered_set.hpp5680644editdlrm
utility.hpp8800644editdlrm
variant.hpp8830644editdlrm
version.hpp11170644editdlrm
visit_each.hpp6900644editdlrm
wave.hpp9440644editdlrm
weak_ptr.hpp4620644editdlrm
Edit: /usr/include/boost/operators_v1.hpp (37735B)
// Boost operators.hpp header file ----------------------------------------// // (C) Copyright David Abrahams, Jeremy Siek, Daryle Walker 1999-2001. // 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) // See http://www.boost.org/libs/utility/operators.htm for documentation. // Revision History // 22 Feb 16 Preserve old work-arounds. (Daniel Frey) // 16 Dec 10 Limit warning suppression for 4284 to older versions of VC++ // (Matthew Bradbury, fixes #4432) // 07 Aug 08 Added "euclidean" spelling. (Daniel Frey) // 03 Apr 08 Make sure "convertible to bool" is sufficient // for T::operator<, etc. (Daniel Frey) // 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 // correct named return value optimization (NRVO) to produce optimal // code. (Daniel Frey) // 02 Dec 01 Bug fixed in random_access_iteratable. (Helmut Zeisel) // 28 Sep 01 Factored out iterator operator groups. (Daryle Walker) // 27 Aug 01 'left' form for non commutative operators added; // additional classes for groups of related operators added; // workaround for empty base class optimization // bug of GCC 3.0 (Helmut Zeisel) // 25 Jun 01 output_iterator_helper changes: removed default template // parameters, added support for self-proxying, additional // documentation and tests (Aleksey Gurtovoy) // 29 May 01 Added operator classes for << and >>. Added input and output // iterator helper classes. Added classes to connect equality and // relational operators. Added classes for groups of related // operators. Reimplemented example operator and iterator helper // classes in terms of the new groups. (Daryle Walker, with help // from Alexy Gurtovoy) // 11 Feb 01 Fixed bugs in the iterator helpers which prevented explicitly // supplied arguments from actually being used (Dave Abrahams) // 04 Jul 00 Fixed NO_OPERATORS_IN_NAMESPACE bugs, major cleanup and // refactoring of compiler workarounds, additional documentation // (Alexy Gurtovoy and Mark Rodgers with some help and prompting from // Dave Abrahams) // 28 Jun 00 General cleanup and integration of bugfixes from Mark Rodgers and // Jeremy Siek (Dave Abrahams) // 20 Jun 00 Changes to accommodate Borland C++Builder 4 and Borland C++ 5.5 // (Mark Rodgers) // 20 Jun 00 Minor fixes to the prior revision (Aleksey Gurtovoy) // 10 Jun 00 Support for the base class chaining technique was added // (Aleksey Gurtovoy). See documentation and the comments below // for the details. // 12 Dec 99 Initial version with iterator operators (Jeremy Siek) // 18 Nov 99 Change name "divideable" to "dividable", remove unnecessary // specializations of dividable, subtractable, modable (Ed Brey) // 17 Nov 99 Add comments (Beman Dawes) // Remove unnecessary specialization of operators<> (Ed Brey) // 15 Nov 99 Fix less_than_comparable second operand type for first two // operators.(Beman Dawes) // 12 Nov 99 Add operators templates (Ed Brey) // 11 Nov 99 Add single template parameter version for compilers without // partial specialization (Beman Dawes) // 10 Nov 99 Initial version // 10 Jun 00: // An additional optional template parameter was added to most of // operator templates to support the base class chaining technique (see // documentation for the details). Unfortunately, a straightforward // implementation of this change would have broken compatibility with the // previous version of the library by making it impossible to use the same // template name (e.g. 'addable') for both the 1- and 2-argument versions of // an operator template. This implementation solves the backward-compatibility // issue at the cost of some simplicity. // // One of the complications is an existence of special auxiliary class template // 'is_chained_base<>' (see 'detail' namespace below), which is used // to determine whether its template parameter is a library's operator template // or not. You have to specialize 'is_chained_base<>' for each new // operator template you add to the library. // // However, most of the non-trivial implementation details are hidden behind // several local macros defined below, and as soon as you understand them, // you understand the whole library implementation. #ifndef BOOST_OPERATORS_V1_HPP #define BOOST_OPERATORS_V1_HPP #include #include #include #include #if defined(__sgi) && !defined(__GNUC__) # pragma set woff 1234 #endif #if BOOST_WORKAROUND(BOOST_MSVC, < 1600) # pragma warning( disable : 4284 ) // complaint about return type of #endif // operator-> not begin a UDT namespace boost { namespace detail { template class empty_base {}; } // namespace detail } // namespace boost // In this section we supply the xxxx1 and xxxx2 forms of the operator // templates, which are explicitly targeted at the 1-type-argument and // 2-type-argument operator forms, respectively. Some compilers get confused // when inline friend functions are overloaded in namespaces other than the // global namespace. When BOOST_NO_OPERATORS_IN_NAMESPACE is defined, all of // these templates must go in the global namespace. #ifndef BOOST_NO_OPERATORS_IN_NAMESPACE namespace boost { #endif // Basic operator classes (contributed by Dave Abrahams) ------------------// // Note that friend functions defined in a class are implicitly inline. // See the C++ std, 11.4 [class.friend] paragraph 5 template > struct less_than_comparable2 : B { friend bool operator<=(const T& x, const U& y) { return !static_cast(x > y); } friend bool operator>=(const T& x, const U& y) { return !static_cast(x < y); } friend bool operator>(const U& x, const T& y) { return y < x; } friend bool operator<(const U& x, const T& y) { return y > x; } friend bool operator<=(const U& x, const T& y) { return !static_cast(y < x); } friend bool operator>=(const U& x, const T& y) { return !static_cast(y > x); } }; template > 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 !static_cast(y < x); } friend bool operator>=(const T& x, const T& y) { return !static_cast(x < y); } }; template > 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 !static_cast(x == y); } friend bool operator!=(const T& y, const U& x) { return !static_cast(y == x); } }; template > struct equality_comparable1 : B { friend bool operator!=(const T& x, const T& y) { return !static_cast(x == y); } }; // A macro which produces "name_2left" from "name". #define BOOST_OPERATOR2_LEFT(name) name##2##_##left // NRVO-friendly implementation (contributed by Daniel Frey) ---------------// #if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) // This is the optimal implementation for ISO/ANSI C++, // but it requires the compiler to implement the NRVO. // If the compiler has no NRVO, this is the best symmetric // implementation available. #define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ template > \ struct NAME##2 : B \ { \ friend T operator OP( const T& lhs, const U& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ friend T operator OP( const U& lhs, const T& rhs ) \ { T nrv( rhs ); nrv OP##= lhs; return nrv; } \ }; \ \ template > \ struct NAME##1 : B \ { \ friend T operator OP( const T& lhs, const T& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; #define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ template > \ struct NAME##2 : B \ { \ friend T operator OP( const T& lhs, const U& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; \ \ template > \ struct BOOST_OPERATOR2_LEFT(NAME) : B \ { \ friend T operator OP( const U& lhs, const T& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; \ \ template > \ struct NAME##1 : B \ { \ friend T operator OP( const T& lhs, const T& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; #else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) // For compilers without NRVO the following code is optimal, but not // symmetric! Note that the implementation of // BOOST_OPERATOR2_LEFT(NAME) only looks cool, but doesn't provide // optimization opportunities to the compiler :) #define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ template > \ struct NAME##2 : B \ { \ 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; } \ }; \ \ template > \ struct NAME##1 : B \ { \ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ }; #define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ template > \ struct NAME##2 : B \ { \ friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ }; \ \ template > \ struct BOOST_OPERATOR2_LEFT(NAME) : B \ { \ friend T operator OP( const U& lhs, const T& rhs ) \ { return T( lhs ) OP##= rhs; } \ }; \ \ template > \ struct NAME##1 : B \ { \ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ }; #endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) BOOST_BINARY_OPERATOR_COMMUTATIVE( multipliable, * ) BOOST_BINARY_OPERATOR_COMMUTATIVE( addable, + ) BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( subtractable, - ) BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( dividable, / ) BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( modable, % ) BOOST_BINARY_OPERATOR_COMMUTATIVE( xorable, ^ ) BOOST_BINARY_OPERATOR_COMMUTATIVE( andable, & ) BOOST_BINARY_OPERATOR_COMMUTATIVE( orable, | ) #undef BOOST_BINARY_OPERATOR_COMMUTATIVE #undef BOOST_BINARY_OPERATOR_NON_COMMUTATIVE #undef BOOST_OPERATOR2_LEFT // incrementable and decrementable contributed by Jeremy Siek template > struct incrementable : B { friend T operator++(T& x, int) { incrementable_type nrv(x); ++x; return nrv; } private: // The use of this typedef works around a Borland bug typedef T incrementable_type; }; template > struct decrementable : B { friend T operator--(T& x, int) { decrementable_type nrv(x); --x; return nrv; } private: // The use of this typedef works around a Borland bug typedef T decrementable_type; }; // Iterator operator classes (contributed by Jeremy Siek) ------------------// template > struct dereferenceable : B { P operator->() const { return &*static_cast(*this); } }; template > struct indexable : B { R operator[](I n) const { return *(static_cast(*this) + n); } }; // More operator classes (contributed by Daryle Walker) --------------------// // (NRVO-friendly implementation contributed by Daniel Frey) ---------------// #if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) #define BOOST_BINARY_OPERATOR( NAME, OP ) \ template > \ struct NAME##2 : B \ { \ friend T operator OP( const T& lhs, const U& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; \ \ template > \ struct NAME##1 : B \ { \ friend T operator OP( const T& lhs, const T& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; #else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) #define BOOST_BINARY_OPERATOR( NAME, OP ) \ template > \ struct NAME##2 : B \ { \ friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ }; \ \ template > \ struct NAME##1 : B \ { \ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ }; #endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) BOOST_BINARY_OPERATOR( left_shiftable, << ) BOOST_BINARY_OPERATOR( right_shiftable, >> ) #undef BOOST_BINARY_OPERATOR template > struct equivalent2 : B { friend bool operator==(const T& x, const U& y) { return !static_cast(x < y) && !static_cast(x > y); } }; template > struct equivalent1 : B { friend bool operator==(const T&x, const T&y) { return !static_cast(x < y) && !static_cast(y < x); } }; template > struct partially_ordered2 : B { friend bool operator<=(const T& x, const U& y) { return static_cast(x < y) || static_cast(x == y); } friend bool operator>=(const T& x, const U& y) { return static_cast(x > y) || static_cast(x == y); } friend bool operator>(const U& x, const T& y) { return y < x; } friend bool operator<(const U& x, const T& y) { return y > x; } friend bool operator<=(const U& x, const T& y) { return static_cast(y > x) || static_cast(y == x); } friend bool operator>=(const U& x, const T& y) { return static_cast(y < x) || static_cast(y == x); } }; template > struct partially_ordered1 : B { friend bool operator>(const T& x, const T& y) { return y < x; } friend bool operator<=(const T& x, const T& y) { return static_cast(x < y) || static_cast(x == y); } friend bool operator>=(const T& x, const T& y) { return static_cast(y < x) || static_cast(x == y); } }; // Combined operator classes (contributed by Daryle Walker) ----------------// template > struct totally_ordered2 : less_than_comparable2 > {}; template > struct totally_ordered1 : less_than_comparable1 > {}; template > struct additive2 : addable2 > {}; template > struct additive1 : addable1 > {}; template > struct multiplicative2 : multipliable2 > {}; template > struct multiplicative1 : multipliable1 > {}; template > struct integer_multiplicative2 : multiplicative2 > {}; template > struct integer_multiplicative1 : multiplicative1 > {}; template > struct arithmetic2 : additive2 > {}; template > struct arithmetic1 : additive1 > {}; template > struct integer_arithmetic2 : additive2 > {}; template > struct integer_arithmetic1 : additive1 > {}; template > struct bitwise2 : xorable2 > > {}; template > struct bitwise1 : xorable1 > > {}; template > struct unit_steppable : incrementable > {}; template > struct shiftable2 : left_shiftable2 > {}; template > struct shiftable1 : left_shiftable1 > {}; template > struct ring_operators2 : additive2 > > {}; template > struct ring_operators1 : additive1 > {}; template > struct ordered_ring_operators2 : ring_operators2 > {}; template > struct ordered_ring_operators1 : ring_operators1 > {}; template > struct field_operators2 : ring_operators2 > > {}; template > struct field_operators1 : ring_operators1 > {}; template > struct ordered_field_operators2 : field_operators2 > {}; template > struct ordered_field_operators1 : field_operators1 > {}; template > struct euclidian_ring_operators2 : ring_operators2 > > > > {}; template > struct euclidian_ring_operators1 : ring_operators1 > > {}; template > struct ordered_euclidian_ring_operators2 : totally_ordered2 > {}; template > struct ordered_euclidian_ring_operators1 : totally_ordered1 > {}; template > struct euclidean_ring_operators2 : ring_operators2 > > > > {}; template > struct euclidean_ring_operators1 : ring_operators1 > > {}; template > struct ordered_euclidean_ring_operators2 : totally_ordered2 > {}; template > struct ordered_euclidean_ring_operators1 : totally_ordered1 > {}; template > struct input_iteratable : equality_comparable1 > > {}; template > struct output_iteratable : incrementable {}; template > struct forward_iteratable : input_iteratable {}; template > struct bidirectional_iteratable : forward_iteratable > {}; // To avoid repeated derivation from equality_comparable, // which is an indirect base class of bidirectional_iterable, // random_access_iteratable must not be derived from totally_ordered1 // but from less_than_comparable1 only. (Helmut Zeisel, 02-Dec-2001) template > struct random_access_iteratable : bidirectional_iteratable > > > {}; #ifndef BOOST_NO_OPERATORS_IN_NAMESPACE } // namespace boost #endif // BOOST_NO_OPERATORS_IN_NAMESPACE // BOOST_IMPORT_TEMPLATE1 .. BOOST_IMPORT_TEMPLATE4 - // // When BOOST_NO_OPERATORS_IN_NAMESPACE is defined we need a way to import an // operator template into the boost namespace. BOOST_IMPORT_TEMPLATE1 is used // for one-argument forms of operator templates; BOOST_IMPORT_TEMPLATE2 for // two-argument forms. Note that these macros expect to be invoked from within // boost. #ifndef BOOST_NO_OPERATORS_IN_NAMESPACE // The template is already in boost so we have nothing to do. # define BOOST_IMPORT_TEMPLATE4(template_name) # define BOOST_IMPORT_TEMPLATE3(template_name) # define BOOST_IMPORT_TEMPLATE2(template_name) # define BOOST_IMPORT_TEMPLATE1(template_name) #else // BOOST_NO_OPERATORS_IN_NAMESPACE # ifndef BOOST_NO_USING_TEMPLATE // Bring the names in with a using-declaration // to avoid stressing the compiler. # define BOOST_IMPORT_TEMPLATE4(template_name) using ::template_name; # define BOOST_IMPORT_TEMPLATE3(template_name) using ::template_name; # define BOOST_IMPORT_TEMPLATE2(template_name) using ::template_name; # define BOOST_IMPORT_TEMPLATE1(template_name) using ::template_name; # else // Otherwise, because a Borland C++ 5.5 bug prevents a using declaration // from working, we are forced to use inheritance for that compiler. # define BOOST_IMPORT_TEMPLATE4(template_name) \ template > \ struct template_name : ::template_name {}; # define BOOST_IMPORT_TEMPLATE3(template_name) \ template > \ struct template_name : ::template_name {}; # define BOOST_IMPORT_TEMPLATE2(template_name) \ template > \ struct template_name : ::template_name {}; # define BOOST_IMPORT_TEMPLATE1(template_name) \ template > \ struct template_name : ::template_name {}; # endif // BOOST_NO_USING_TEMPLATE #endif // BOOST_NO_OPERATORS_IN_NAMESPACE // // Here's where we put it all together, defining the xxxx forms of the templates // in namespace boost. We also define specializations of is_chained_base<> for // the xxxx, xxxx1, and xxxx2 templates, importing them into boost:: as // necessary. // // is_chained_base<> - a traits class used to distinguish whether an operator // template argument is being used for base class chaining, or is specifying a // 2nd argument type. namespace boost { // A type parameter is used instead of a plain bool because Borland's compiler // didn't cope well with the more obvious non-type template parameter. namespace detail { struct true_t {}; struct false_t {}; } // namespace detail // Unspecialized version assumes that most types are not being used for base // class chaining. We specialize for the operator templates defined in this // library. template struct is_chained_base { typedef ::boost::detail::false_t value; }; } // namespace boost // Import a 4-type-argument operator template into boost (if necessary) and // provide a specialization of 'is_chained_base<>' for it. # define BOOST_OPERATOR_TEMPLATE4(template_name4) \ BOOST_IMPORT_TEMPLATE4(template_name4) \ template \ struct is_chained_base< ::boost::template_name4 > { \ typedef ::boost::detail::true_t value; \ }; // Import a 3-type-argument operator template into boost (if necessary) and // provide a specialization of 'is_chained_base<>' for it. # define BOOST_OPERATOR_TEMPLATE3(template_name3) \ BOOST_IMPORT_TEMPLATE3(template_name3) \ template \ struct is_chained_base< ::boost::template_name3 > { \ typedef ::boost::detail::true_t value; \ }; // Import a 2-type-argument operator template into boost (if necessary) and // provide a specialization of 'is_chained_base<>' for it. # define BOOST_OPERATOR_TEMPLATE2(template_name2) \ BOOST_IMPORT_TEMPLATE2(template_name2) \ template \ struct is_chained_base< ::boost::template_name2 > { \ typedef ::boost::detail::true_t value; \ }; // Import a 1-type-argument operator template into boost (if necessary) and // provide a specialization of 'is_chained_base<>' for it. # define BOOST_OPERATOR_TEMPLATE1(template_name1) \ BOOST_IMPORT_TEMPLATE1(template_name1) \ template \ struct is_chained_base< ::boost::template_name1 > { \ typedef ::boost::detail::true_t value; \ }; // BOOST_OPERATOR_TEMPLATE(template_name) defines template_name<> such that it // can be used for specifying both 1-argument and 2-argument forms. Requires the // existence of two previously defined class templates named '1' // and '2' which must implement the corresponding 1- and 2- // argument forms. // // The template type parameter O == is_chained_base::value is used to // distinguish whether the 2nd argument to is being used for // base class chaining from another boost operator template or is describing a // 2nd operand type. O == true_t only when U is actually an another operator // template from the library. Partial specialization is used to select an // implementation in terms of either '1' or '2'. // # define BOOST_OPERATOR_TEMPLATE(template_name) \ template \ ,class O = typename is_chained_base::value \ > \ struct template_name : template_name##2 {}; \ \ template \ struct template_name \ : template_name##1 {}; \ \ template \ struct template_name \ : template_name##1 {}; \ \ template \ struct is_chained_base< ::boost::template_name > { \ typedef ::boost::detail::true_t value; \ }; \ \ BOOST_OPERATOR_TEMPLATE2(template_name##2) \ BOOST_OPERATOR_TEMPLATE1(template_name##1) namespace boost { BOOST_OPERATOR_TEMPLATE(less_than_comparable) BOOST_OPERATOR_TEMPLATE(equality_comparable) BOOST_OPERATOR_TEMPLATE(multipliable) BOOST_OPERATOR_TEMPLATE(addable) BOOST_OPERATOR_TEMPLATE(subtractable) BOOST_OPERATOR_TEMPLATE2(subtractable2_left) BOOST_OPERATOR_TEMPLATE(dividable) BOOST_OPERATOR_TEMPLATE2(dividable2_left) BOOST_OPERATOR_TEMPLATE(modable) BOOST_OPERATOR_TEMPLATE2(modable2_left) BOOST_OPERATOR_TEMPLATE(xorable) BOOST_OPERATOR_TEMPLATE(andable) BOOST_OPERATOR_TEMPLATE(orable) BOOST_OPERATOR_TEMPLATE1(incrementable) BOOST_OPERATOR_TEMPLATE1(decrementable) BOOST_OPERATOR_TEMPLATE2(dereferenceable) BOOST_OPERATOR_TEMPLATE3(indexable) BOOST_OPERATOR_TEMPLATE(left_shiftable) BOOST_OPERATOR_TEMPLATE(right_shiftable) BOOST_OPERATOR_TEMPLATE(equivalent) BOOST_OPERATOR_TEMPLATE(partially_ordered) BOOST_OPERATOR_TEMPLATE(totally_ordered) BOOST_OPERATOR_TEMPLATE(additive) BOOST_OPERATOR_TEMPLATE(multiplicative) BOOST_OPERATOR_TEMPLATE(integer_multiplicative) BOOST_OPERATOR_TEMPLATE(arithmetic) BOOST_OPERATOR_TEMPLATE(integer_arithmetic) BOOST_OPERATOR_TEMPLATE(bitwise) BOOST_OPERATOR_TEMPLATE1(unit_steppable) BOOST_OPERATOR_TEMPLATE(shiftable) BOOST_OPERATOR_TEMPLATE(ring_operators) BOOST_OPERATOR_TEMPLATE(ordered_ring_operators) BOOST_OPERATOR_TEMPLATE(field_operators) BOOST_OPERATOR_TEMPLATE(ordered_field_operators) BOOST_OPERATOR_TEMPLATE(euclidian_ring_operators) BOOST_OPERATOR_TEMPLATE(ordered_euclidian_ring_operators) BOOST_OPERATOR_TEMPLATE(euclidean_ring_operators) BOOST_OPERATOR_TEMPLATE(ordered_euclidean_ring_operators) BOOST_OPERATOR_TEMPLATE2(input_iteratable) BOOST_OPERATOR_TEMPLATE1(output_iteratable) BOOST_OPERATOR_TEMPLATE2(forward_iteratable) BOOST_OPERATOR_TEMPLATE2(bidirectional_iteratable) BOOST_OPERATOR_TEMPLATE4(random_access_iteratable) #undef BOOST_OPERATOR_TEMPLATE #undef BOOST_OPERATOR_TEMPLATE4 #undef BOOST_OPERATOR_TEMPLATE3 #undef BOOST_OPERATOR_TEMPLATE2 #undef BOOST_OPERATOR_TEMPLATE1 #undef BOOST_IMPORT_TEMPLATE1 #undef BOOST_IMPORT_TEMPLATE2 #undef BOOST_IMPORT_TEMPLATE3 #undef BOOST_IMPORT_TEMPLATE4 // The following 'operators' classes can only be used portably if the derived class // declares ALL of the required member operators. template struct operators2 : totally_ordered2 > > {}; template struct operators : operators2 {}; template struct operators : totally_ordered > > > {}; // Iterator helper classes (contributed by Jeremy Siek) -------------------// // (Input and output iterator helpers contributed by Daryle Walker) -------// // (Changed to use combined operator classes by Daryle Walker) ------------// template struct input_iterator_helper : input_iteratable > {}; template struct output_iterator_helper : output_iteratable > { T& operator*() { return static_cast(*this); } T& operator++() { return static_cast(*this); } }; template struct forward_iterator_helper : forward_iteratable > {}; template struct bidirectional_iterator_helper : bidirectional_iteratable > {}; template struct random_access_iterator_helper : random_access_iteratable > { friend D requires_difference_operator(const T& x, const T& y) { return x - y; } }; // random_access_iterator_helper } // namespace boost #if defined(__sgi) && !defined(__GNUC__) #pragma reset woff 1234 #endif #endif // BOOST_OPERATORS_V1_HPP