Edit: /usr/include/boost/foreach.hpp (45551B)
///////////////////////////////////////////////////////////////////////////////
// foreach.hpp header file
//
// Copyright 2004 Eric Niebler.
// 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/foreach for documentation
//
// Credits:
// Anson Tsao - for the initial inspiration and several good suggestions.
// Thorsten Ottosen - for Boost.Range, and for suggesting a way to detect
// const-qualified rvalues at compile time on VC7.1+
// Russell Hind - For help porting to Borland
// Alisdair Meredith - For help porting to Borland
// Stefan Slapeta - For help porting to Intel
// David Jenkins - For help finding a Microsoft Code Analysis bug
// mimomorin@... - For a patch to use rvalue refs on supporting compilers
#ifndef BOOST_FOREACH
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
#include
#include // for std::pair
#include
#include
// Define a compiler generic null pointer value
#if defined(BOOST_NO_NULLPTR)
#define BOOST_FOREACH_NULL 0
#else
#define BOOST_FOREACH_NULL nullptr
#endif
// Some compilers let us detect even const-qualified rvalues at compile-time
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
|| defined(BOOST_MSVC) && !defined(_PREFAST_) \
|| (BOOST_WORKAROUND(__GNUC__, == 4) && (__GNUC_MINOR__ <= 5) && !defined(BOOST_INTEL) && \
!defined(BOOST_CLANG)) \
|| (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) && !defined(BOOST_INTEL) && \
!defined(BOOST_CLANG))
# define BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION
#else
// Some compilers allow temporaries to be bound to non-const references.
// These compilers make it impossible to for BOOST_FOREACH to detect
// temporaries and avoid reevaluation of the collection expression.
# if BOOST_WORKAROUND(__BORLANDC__, < 0x593) \
|| (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \
|| BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100) \
|| BOOST_WORKAROUND(__DECCXX_VER, <= 60590042)
# define BOOST_FOREACH_NO_RVALUE_DETECTION
# endif
// Some compilers do not correctly implement the lvalue/rvalue conversion
// rules of the ternary conditional operator.
# if defined(BOOST_FOREACH_NO_RVALUE_DETECTION) \
|| defined(BOOST_NO_SFINAE) \
|| BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
|| BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(1400)) \
|| (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ <= 3) && defined(__APPLE_CC__)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) \
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) \
|| BOOST_WORKAROUND(__SUNPRO_CC, >= 0x5100) \
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590))
# define BOOST_FOREACH_NO_CONST_RVALUE_DETECTION
# else
# define BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION
# endif
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION
# include
# include
# include
# include
#endif
namespace boost
{
// forward declarations for iterator_range
template
class iterator_range;
// forward declarations for sub_range
template
class sub_range;
namespace foreach
{
///////////////////////////////////////////////////////////////////////////////
// in_range
//
template
inline std::pair in_range(T begin, T end)
{
return std::make_pair(begin, end);
}
///////////////////////////////////////////////////////////////////////////////
// boost::foreach::is_lightweight_proxy
// Specialize this for user-defined collection types if they are inexpensive to copy.
// This tells BOOST_FOREACH it can avoid the rvalue/lvalue detection stuff.
template
struct is_lightweight_proxy
: boost::mpl::false_
{
};
///////////////////////////////////////////////////////////////////////////////
// boost::foreach::is_noncopyable
// Specialize this for user-defined collection types if they cannot be copied.
// This also tells BOOST_FOREACH to avoid the rvalue/lvalue detection stuff.
template
struct is_noncopyable
#if !defined(BOOST_BROKEN_IS_BASE_AND_DERIVED) && !defined(BOOST_NO_IS_ABSTRACT)
: boost::mpl::or_<
boost::is_abstract
, boost::is_base_and_derived
>
#elif !defined(BOOST_BROKEN_IS_BASE_AND_DERIVED)
: boost::is_base_and_derived
#elif !defined(BOOST_NO_IS_ABSTRACT)
: boost::is_abstract
#else
: boost::mpl::false_
#endif
{
};
} // namespace foreach
} // namespace boost
// vc6/7 needs help ordering the following overloads
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
# define BOOST_FOREACH_TAG_DEFAULT ...
#else
# define BOOST_FOREACH_TAG_DEFAULT boost::foreach::tag
#endif
///////////////////////////////////////////////////////////////////////////////
// boost_foreach_is_lightweight_proxy
// Another customization point for the is_lightweight_proxy optimization,
// this one works on legacy compilers. Overload boost_foreach_is_lightweight_proxy
// at the global namespace for your type.
template
inline boost::foreach::is_lightweight_proxy *
boost_foreach_is_lightweight_proxy(T *&, BOOST_FOREACH_TAG_DEFAULT) { return 0; }
template
inline boost::mpl::true_ *
boost_foreach_is_lightweight_proxy(std::pair *&, boost::foreach::tag) { return 0; }
template
inline boost::mpl::true_ *
boost_foreach_is_lightweight_proxy(boost::iterator_range *&, boost::foreach::tag) { return 0; }
template
inline boost::mpl::true_ *
boost_foreach_is_lightweight_proxy(boost::sub_range *&, boost::foreach::tag) { return 0; }
template
inline boost::mpl::true_ *
boost_foreach_is_lightweight_proxy(T **&, boost::foreach::tag) { return 0; }
///////////////////////////////////////////////////////////////////////////////
// boost_foreach_is_noncopyable
// Another customization point for the is_noncopyable trait,
// this one works on legacy compilers. Overload boost_foreach_is_noncopyable
// at the global namespace for your type.
template
inline boost::foreach::is_noncopyable *
boost_foreach_is_noncopyable(T *&, BOOST_FOREACH_TAG_DEFAULT) { return 0; }
namespace boost
{
namespace foreach_detail_
{
///////////////////////////////////////////////////////////////////////////////
// Define some utilities for assessing the properties of expressions
//
template
inline boost::mpl::and_ *and_(Bool1 *, Bool2 *) { return 0; }
template
inline boost::mpl::and_ *and_(Bool1 *, Bool2 *, Bool3 *) { return 0; }
template
inline boost::mpl::or_ *or_(Bool1 *, Bool2 *) { return 0; }
template
inline boost::mpl::or_ *or_(Bool1 *, Bool2 *, Bool3 *) { return 0; }
template
inline boost::mpl::not_ *not_(Bool1 *) { return 0; }
template
inline boost::is_array *is_array_(T const &) { return 0; }
template
inline boost::is_const *is_const_(T &) { return 0; }
#ifndef BOOST_FOREACH_NO_RVALUE_DETECTION
template
inline boost::mpl::true_ *is_const_(T const &) { return 0; }
#endif
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
template
inline boost::mpl::false_ *is_rvalue_(T &, int) { return 0; }
template
inline boost::mpl::true_ *is_rvalue_(T const &, ...) { return 0; }
#else
template
inline boost::is_rvalue_reference *is_rvalue_(T &&, int) { return 0; }
#endif
///////////////////////////////////////////////////////////////////////////////
// auto_any_t/auto_any
// General utility for putting an object of any type into automatic storage
struct auto_any_base
{
// auto_any_base must evaluate to false in boolean context so that
// they can be declared in if() statements.
operator bool() const
{
return false;
}
};
template
struct auto_any : auto_any_base
{
explicit auto_any(T const &t)
: item(t)
{
}
// temporaries of type auto_any will be bound to const auto_any_base
// references, but we still want to be able to mutate the stored
// data, so declare it as mutable.
mutable T item;
};
typedef auto_any_base const &auto_any_t;
template
inline BOOST_DEDUCED_TYPENAME boost::mpl::if_::type &auto_any_cast(auto_any_t a)
{
return static_cast const &>(a).item;
}
typedef boost::mpl::true_ const_;
///////////////////////////////////////////////////////////////////////////////
// type2type
//
template
struct type2type
: boost::mpl::if_
{
};
template
struct wrap_cstr
{
typedef T type;
};
template<>
struct wrap_cstr
{
typedef wrap_cstr type;
typedef char *iterator;
typedef char *const_iterator;
};
template<>
struct wrap_cstr
{
typedef wrap_cstr type;
typedef char const *iterator;
typedef char const *const_iterator;
};
template<>
struct wrap_cstr
{
typedef wrap_cstr type;
typedef wchar_t *iterator;
typedef wchar_t *const_iterator;
};
template<>
struct wrap_cstr
{
typedef wrap_cstr type;
typedef wchar_t const *iterator;
typedef wchar_t const *const_iterator;
};
template
struct is_char_array
: mpl::and_<
is_array
, mpl::or_<
is_convertible
, is_convertible
>
>
{};
template
struct foreach_iterator
{
// **** READ THIS IF YOUR COMPILE BREAKS HERE ****
//
// There is an ambiguity about how to iterate over arrays of char and wchar_t.
// Should the last array element be treated as a null terminator to be skipped, or
// is it just like any other element in the array? To fix the problem, you must
// say which behavior you want.
//
// To treat the container as a null-terminated string, merely cast it to a
// char const *, as in BOOST_FOREACH( char ch, (char const *)"hello" ) ...
//
// To treat the container as an array, use boost::as_array() in ,
// as in BOOST_FOREACH( char ch, boost::as_array("hello") ) ...
BOOST_MPL_ASSERT_MSG( (!is_char_array::value), IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING, (T&) );
// If the type is a pointer to a null terminated string (as opposed
// to an array type), there is no ambiguity.
typedef BOOST_DEDUCED_TYPENAME wrap_cstr::type container;
typedef BOOST_DEDUCED_TYPENAME boost::mpl::eval_if<
C
, range_const_iterator
, range_mutable_iterator
>::type type;
};
template
struct foreach_reverse_iterator
{
// **** READ THIS IF YOUR COMPILE BREAKS HERE ****
//
// There is an ambiguity about how to iterate over arrays of char and wchar_t.
// Should the last array element be treated as a null terminator to be skipped, or
// is it just like any other element in the array? To fix the problem, you must
// say which behavior you want.
//
// To treat the container as a null-terminated string, merely cast it to a
// char const *, as in BOOST_FOREACH( char ch, (char const *)"hello" ) ...
//
// To treat the container as an array, use boost::as_array() in ,
// as in BOOST_FOREACH( char ch, boost::as_array("hello") ) ...
BOOST_MPL_ASSERT_MSG( (!is_char_array::value), IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING, (T&) );
// If the type is a pointer to a null terminated string (as opposed
// to an array type), there is no ambiguity.
typedef BOOST_DEDUCED_TYPENAME wrap_cstr::type container;
typedef BOOST_DEDUCED_TYPENAME boost::mpl::eval_if<
C
, range_reverse_iterator
, range_reverse_iterator
>::type type;
};
template
struct foreach_reference
: iterator_reference::type>
{
};
///////////////////////////////////////////////////////////////////////////////
// encode_type
//
template
inline type2type *encode_type(T &, boost::false_type*) { return 0; }
template
inline type2type *encode_type(T const &, boost::true_type*) { return 0; }
template
inline type2type *encode_type(T &, boost::mpl::false_*) { return 0; }
template
inline type2type *encode_type(T const &, boost::mpl::true_*) { return 0; }
///////////////////////////////////////////////////////////////////////////////
// set_false
//
inline bool set_false(bool &b)
{
b = false;
return false;
}
///////////////////////////////////////////////////////////////////////////////
// to_ptr
//
template
inline T *&to_ptr(T const &)
{
static T *t = 0;
return t;
}
// Borland needs a little extra help with arrays
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
template
inline T (*&to_ptr(T (&)[N]))[N]
{
static T (*t)[N] = 0;
return t;
}
///////////////////////////////////////////////////////////////////////////////
// derefof
//
template
inline T &derefof(T *t)
{
// This is a work-around for a compiler bug in Borland. If T* is a pointer to array type U(*)[N],
// then dereferencing it results in a U* instead of U(&)[N]. The cast forces the issue.
return reinterpret_cast(
*const_cast(
reinterpret_cast(t)
)
);
}
# define BOOST_FOREACH_DEREFOF(T) boost::foreach_detail_::derefof(*T)
#else
# define BOOST_FOREACH_DEREFOF(T) (*T)
#endif
#if defined(BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION) \
&& !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
///////////////////////////////////////////////////////////////////////////////
// Rvalue references makes it drop-dead simple to detect at compile time
// whether an expression is an rvalue.
///////////////////////////////////////////////////////////////////////////////
# define BOOST_FOREACH_IS_RVALUE(COL) \
boost::foreach_detail_::is_rvalue_((COL), 0)
#elif defined(BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION) \
&& defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
///////////////////////////////////////////////////////////////////////////////
// Detect at compile-time whether an expression yields an rvalue or
// an lvalue. This is rather non-standard, but some popular compilers
// accept it.
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// rvalue_probe
//
template
struct rvalue_probe
{
struct private_type_ {};
// can't ever return an array by value
typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_<
boost::mpl::or_, boost::is_array >, private_type_, T
>::type value_type;
operator value_type() { return *reinterpret_cast(this); } // never called
operator T &() const { return *reinterpret_cast(const_cast(this)); } // never called
};
template
rvalue_probe const make_probe(T const &)
{
return rvalue_probe();
}
# define BOOST_FOREACH_IS_RVALUE(COL) \
boost::foreach_detail_::and_( \
boost::foreach_detail_::not_(boost::foreach_detail_::is_array_(COL)) \
, (true ? 0 : boost::foreach_detail_::is_rvalue_( \
(true ? boost::foreach_detail_::make_probe(COL) : (COL)), 0)))
#elif defined(BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION)
///////////////////////////////////////////////////////////////////////////////
// Detect at run-time whether an expression yields an rvalue
// or an lvalue. This is 100% standard C++, but not all compilers
// accept it. Also, it causes FOREACH to break when used with non-
// copyable collection types.
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// rvalue_probe
//
template
struct rvalue_probe
{
rvalue_probe(T &t, bool &b)
: value(t)
, is_rvalue(b)
{
}
struct private_type_ {};
// can't ever return an array or an abstract type by value
#ifdef BOOST_NO_IS_ABSTRACT
typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_<
boost::is_array, private_type_, T
>::type value_type;
#else
typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_<
boost::mpl::or_, boost::is_array >, private_type_, T
>::type value_type;
#endif
operator value_type()
{
this->is_rvalue = true;
return this->value;
}
operator T &() const
{
return this->value;
}
private:
T &value;
bool &is_rvalue;
};
template
rvalue_probe make_probe(T &t, bool &b) { return rvalue_probe(t, b); }
template
rvalue_probe make_probe(T const &t, bool &b) { return rvalue_probe(t, b); }
///////////////////////////////////////////////////////////////////////////////
// simple_variant
// holds either a T or a T const*
template
struct simple_variant
{
simple_variant(T const *t)
: is_rvalue(false)
{
*static_cast(this->data.address()) = t;
}
simple_variant(T const &t)
: is_rvalue(true)
{
::new(this->data.address()) T(t);
}
simple_variant(simple_variant const &that)
: is_rvalue(that.is_rvalue)
{
if(this->is_rvalue)
::new(this->data.address()) T(*that.get());
else
*static_cast(this->data.address()) = that.get();
}
~simple_variant()
{
if(this->is_rvalue)
this->get()->~T();
}
T const *get() const
{
if(this->is_rvalue)
return static_cast(this->data.address());
else
return *static_cast(this->data.address());
}
private:
enum size_type { size = sizeof(T) > sizeof(T*) ? sizeof(T) : sizeof(T*) };
simple_variant &operator =(simple_variant const &);
bool const is_rvalue;
aligned_storage data;
};
// If the collection is an array or is noncopyable, it must be an lvalue.
// If the collection is a lightweight proxy, treat it as an rvalue
// BUGBUG what about a noncopyable proxy?
template
inline BOOST_DEDUCED_TYPENAME boost::enable_if, IsProxy>::type *
should_copy_impl(LValue *, IsProxy *, bool *)
{
return 0;
}
// Otherwise, we must determine at runtime whether it's an lvalue or rvalue
inline bool *
should_copy_impl(boost::mpl::false_ *, boost::mpl::false_ *, bool *is_rvalue)
{
return is_rvalue;
}
#endif
///////////////////////////////////////////////////////////////////////////////
// contain
//
template
inline auto_any contain(T const &t, boost::mpl::true_ *) // rvalue
{
return auto_any(t);
}
template
inline auto_any contain(T &t, boost::mpl::false_ *) // lvalue
{
// Cannot seem to get sunpro to handle addressof() with array types.
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x570))
return auto_any(&t);
#else
return auto_any(boost::addressof(t));
#endif
}
#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION
template
inline auto_any >
contain(T const &t, bool *rvalue)
{
return auto_any >(*rvalue ? simple_variant(t) : simple_variant(&t));
}
#endif
/////////////////////////////////////////////////////////////////////////////
// begin
//
template
inline auto_any::type>
begin(auto_any_t col, type2type *, boost::mpl::true_ *) // rvalue
{
return auto_any::type>(
boost::begin(auto_any_cast(col)));
}
template
inline auto_any::type>
begin(auto_any_t col, type2type *, boost::mpl::false_ *) // lvalue
{
typedef BOOST_DEDUCED_TYPENAME type2type::type type;
typedef BOOST_DEDUCED_TYPENAME foreach_iterator::type iterator;
return auto_any::type>(
iterator(boost::begin(BOOST_FOREACH_DEREFOF((auto_any_cast(col))))));
}
#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION
template
inline auto_any::type>
begin(auto_any_t col, type2type *, bool *)
{
return auto_any::type>(
boost::begin(*auto_any_cast, boost::mpl::false_>(col).get()));
}
#endif
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template
inline auto_any
begin(auto_any_t col, type2type *, boost::mpl::true_ *) // null-terminated C-style strings
{
return auto_any(auto_any_cast(col));
}
#endif
///////////////////////////////////////////////////////////////////////////////
// end
//
template
inline auto_any::type>
end(auto_any_t col, type2type *, boost::mpl::true_ *) // rvalue
{
return auto_any::type>(
boost::end(auto_any_cast(col)));
}
template
inline auto_any::type>
end(auto_any_t col, type2type *, boost::mpl::false_ *) // lvalue
{
typedef BOOST_DEDUCED_TYPENAME type2type::type type;
typedef BOOST_DEDUCED_TYPENAME foreach_iterator::type iterator;
return auto_any::type>(
iterator(boost::end(BOOST_FOREACH_DEREFOF((auto_any_cast(col))))));
}
#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION
template
inline auto_any::type>
end(auto_any_t col, type2type *, bool *)
{
return auto_any::type>(
boost::end(*auto_any_cast, boost::mpl::false_>(col).get()));
}
#endif
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template
inline auto_any
end(auto_any_t, type2type *, boost::mpl::true_ *) // null-terminated C-style strings
{
return auto_any(0); // not used
}
#endif
///////////////////////////////////////////////////////////////////////////////
// done
//
template
inline bool done(auto_any_t cur, auto_any_t end, type2type *)
{
typedef BOOST_DEDUCED_TYPENAME foreach_iterator::type iter_t;
return auto_any_cast(cur) == auto_any_cast(end);
}
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template
inline bool done(auto_any_t cur, auto_any_t, type2type *) // null-terminated C-style strings
{
return ! *auto_any_cast(cur);
}
#endif
///////////////////////////////////////////////////////////////////////////////
// next
//
template
inline void next(auto_any_t cur, type2type *)
{
typedef BOOST_DEDUCED_TYPENAME foreach_iterator::type iter_t;
++auto_any_cast(cur);
}
///////////////////////////////////////////////////////////////////////////////
// deref
//
template
inline BOOST_DEDUCED_TYPENAME foreach_reference::type
deref(auto_any_t cur, type2type *)
{
typedef BOOST_DEDUCED_TYPENAME foreach_iterator::type iter_t;
return *auto_any_cast(cur);
}
/////////////////////////////////////////////////////////////////////////////
// rbegin
//
template
inline auto_any::type>
rbegin(auto_any_t col, type2type *, boost::mpl::true_ *) // rvalue
{
return auto_any::type>(
boost::rbegin(auto_any_cast(col)));
}
template
inline auto_any::type>
rbegin(auto_any_t col, type2type *, boost::mpl::false_ *) // lvalue
{
typedef BOOST_DEDUCED_TYPENAME type2type::type type;
typedef BOOST_DEDUCED_TYPENAME foreach_reverse_iterator::type iterator;
return auto_any::type>(
iterator(boost::rbegin(BOOST_FOREACH_DEREFOF((auto_any_cast(col))))));
}
#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION
template
inline auto_any::type>
rbegin(auto_any_t col, type2type *, bool *)
{
return auto_any::type>(
boost::rbegin(*auto_any_cast, boost::mpl::false_>(col).get()));
}
#endif
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template
inline auto_any >
rbegin(auto_any_t col, type2type *, boost::mpl::true_ *) // null-terminated C-style strings
{
T *p = auto_any_cast(col);
while(0 != *p)
++p;
return auto_any >(reverse_iterator(p));
}
#endif
///////////////////////////////////////////////////////////////////////////////
// rend
//
template
inline auto_any::type>
rend(auto_any_t col, type2type *, boost::mpl::true_ *) // rvalue
{
return auto_any::type>(
boost::rend(auto_any_cast(col)));
}
template
inline auto_any::type>
rend(auto_any_t col, type2type *, boost::mpl::false_ *) // lvalue
{
typedef BOOST_DEDUCED_TYPENAME type2type::type type;
typedef BOOST_DEDUCED_TYPENAME foreach_reverse_iterator::type iterator;
return auto_any::type>(
iterator(boost::rend(BOOST_FOREACH_DEREFOF((auto_any_cast(col))))));
}
#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION
template
inline auto_any::type>
rend(auto_any_t col, type2type *, bool *)
{
return auto_any::type>(
boost::rend(*auto_any_cast, boost::mpl::false_>(col).get()));
}
#endif
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template