34 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \ 35 || defined(BOOST_MSVC) && !defined(_PREFAST_) \ 36 || (BOOST_WORKAROUND(__GNUC__, == 4) && (__GNUC_MINOR__ <= 5) && !defined(BOOST_INTEL) && \ 37 !defined(BOOST_CLANG)) \ 38 || (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) && !defined(BOOST_INTEL) && \ 39 !defined(BOOST_CLANG)) 40 # define BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION 45 # if BOOST_WORKAROUND(__BORLANDC__, < 0x593) \ 46 || (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \ 47 || BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100) \ 48 || BOOST_WORKAROUND(__DECCXX_VER, <= 60590042) 49 # define BOOST_FOREACH_NO_RVALUE_DETECTION 53 # if defined(BOOST_FOREACH_NO_RVALUE_DETECTION) \ 54 || defined(BOOST_NO_SFINAE) \ 55 || BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ 56 || BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(1400)) \ 57 || (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ <= 3) && defined(__APPLE_CC__)) \ 58 || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) \ 59 || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) \ 60 || BOOST_WORKAROUND(__SUNPRO_CC, >= 0x5100) \ 61 || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590)) 62 # define BOOST_FOREACH_NO_CONST_RVALUE_DETECTION 64 # define BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION 88 #ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION 90 # include <boost/aligned_storage.hpp> 114 return std::make_pair(begin, end);
133 #if !defined(BOOST_BROKEN_IS_BASE_AND_DERIVED) && !defined(BOOST_NO_IS_ABSTRACT)
138 #elif !defined(BOOST_BROKEN_IS_BASE_AND_DERIVED)
140 #elif !defined(BOOST_NO_IS_ABSTRACT)
153 #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING 154 # define BOOST_FOREACH_TAG_DEFAULT ... 156 # define BOOST_FOREACH_TAG_DEFAULT boost::foreach::tag 196 namespace foreach_detail_
202 template<
typename Bool1,
typename Bool2>
205 template<
typename Bool1,
typename Bool2,
typename Bool3>
208 template<
typename Bool1,
typename Bool2>
211 template<
typename Bool1,
typename Bool2,
typename Bool3>
214 template<
typename Bool1>
223 #ifndef BOOST_FOREACH_NO_RVALUE_DETECTION 228 #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES 246 operator bool()
const 268 template<
typename T,
typename C>
279 template<
typename T,
typename C = boost::mpl::false_>
328 is_convertible<T, char const *>
329 , is_convertible<T, wchar_t const *>
334 template<
typename T,
typename C = boost::mpl::false_>
363 template<
typename T,
typename C = boost::mpl::false_>
391 template<
typename T,
typename C = boost::mpl::false_>
393 : iterator_reference<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type>
432 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) 433 template<
typename T,std::
size_t N>
436 static T (*
t)[N] = 0;
444 inline T &derefof(
T *
t)
448 return reinterpret_cast<T &
>(
450 reinterpret_cast<char const volatile *
>(
t)
455 # define BOOST_FOREACH_DEREFOF(T) boost::foreach_detail_::derefof(*T) 457 # define BOOST_FOREACH_DEREFOF(T) (*T) 460 #if defined(BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION) \ 461 && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) 467 # define BOOST_FOREACH_IS_RVALUE(COL) \ 468 boost::foreach_detail_::is_rvalue_((COL), 0) 470 #elif defined(BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION) \ 471 && defined(BOOST_NO_CXX11_RVALUE_REFERENCES) 484 struct private_type_ {};
489 operator value_type() {
return *
reinterpret_cast<value_type *
>(
this); }
490 operator T &()
const {
return *
reinterpret_cast<T *
>(
const_cast<rvalue_probe *
>(
this)); }
494 rvalue_probe<T>
const make_probe(
T const &)
496 return rvalue_probe<T>();
499 # define BOOST_FOREACH_IS_RVALUE(COL) \ 500 boost::foreach_detail_::and_( \ 501 boost::foreach_detail_::not_(boost::foreach_detail_::is_array_(COL)) \ 502 , (true ? 0 : boost::foreach_detail_::is_rvalue_( \ 503 (true ? boost::foreach_detail_::make_probe(COL) : (COL)), 0))) 505 #elif defined(BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION) 519 rvalue_probe(
T &t,
bool &
b)
525 struct private_type_ {};
527 #ifdef BOOST_NO_IS_ABSTRACT 537 operator value_type()
539 this->is_rvalue =
true;
554 rvalue_probe<T> make_probe(
T &t,
bool &
b) {
return rvalue_probe<T>(
t,
b); }
557 rvalue_probe<T const> make_probe(
T const &t,
bool &b) {
return rvalue_probe<T const>(
t,
b); }
563 struct simple_variant
565 simple_variant(
T const *t)
568 *
static_cast<T const **
>(this->
data.address()) = t;
571 simple_variant(
T const &t)
574 ::new(this->
data.address())
T(t);
577 simple_variant(simple_variant
const &that)
578 : is_rvalue(that.is_rvalue)
581 ::new(this->
data.address())
T(*that.get());
583 *
static_cast<T const **
>(this->
data.address()) = that.get();
595 return static_cast<T const *
>(this->
data.address());
597 return *
static_cast<T const *
const *
>(this->
data.address());
601 enum size_type {
size =
sizeof(
T) >
sizeof(
T*) ?
sizeof(
T) :
sizeof(
T*) };
602 simple_variant &operator =(simple_variant
const &);
603 bool const is_rvalue;
604 aligned_storage<size>
data;
610 template<
typename LValue,
typename IsProxy>
612 should_copy_impl(LValue *, IsProxy *,
bool *)
639 #if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x570)) 646 #ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION 658 template<
typename T,
typename C>
666 template<
typename T,
typename C>
676 #ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION 686 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING 687 template<
typename T,
typename C>
698 template<
typename T,
typename C>
706 template<
typename T,
typename C>
716 #ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION 726 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING 727 template<
typename T,
typename C>
738 template<
typename T,
typename C>
745 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING 746 template<
typename T,
typename C>
756 template<
typename T,
typename C>
766 template<
typename T,
typename C>
777 template<
typename T,
typename C>
785 template<
typename T,
typename C>
795 #ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION 805 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING 806 template<
typename T,
typename C>
820 template<
typename T,
typename C>
828 template<
typename T,
typename C>
838 #ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION 848 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING 849 template<
typename T,
typename C>
861 template<
typename T,
typename C>
871 template<
typename T,
typename C>
881 template<
typename T,
typename C>
893 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) 894 # define BOOST_FOREACH_SUPPRESS_WARNINGS() __pragma(warning(suppress:6001)) 896 # define BOOST_FOREACH_SUPPRESS_WARNINGS() 902 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) 905 # define BOOST_FOREACH_ID(x) x 907 # define BOOST_FOREACH_ID(x) BOOST_PP_CAT(x, __LINE__) 911 #define BOOST_FOREACH_TYPEOF(COL) \ 912 (true ? 0 : boost::foreach_detail_::encode_type(COL, boost::foreach_detail_::is_const_(COL))) 915 #define BOOST_FOREACH_IS_NONCOPYABLE(COL) \ 916 boost_foreach_is_noncopyable( \ 917 boost::foreach_detail_::to_ptr(COL) \ 918 , boost_foreach_argument_dependent_lookup_hack_value) 921 #define BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL) \ 922 boost::foreach_detail_::and_( \ 923 boost::foreach_detail_::not_(BOOST_FOREACH_IS_NONCOPYABLE(COL)) \ 924 , boost_foreach_is_lightweight_proxy( \ 925 boost::foreach_detail_::to_ptr(COL) \ 926 , boost_foreach_argument_dependent_lookup_hack_value)) 928 #if defined(BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION) 934 # define BOOST_FOREACH_PREAMBLE() \ 935 BOOST_FOREACH_SUPPRESS_WARNINGS() 938 # define BOOST_FOREACH_EVALUATE(COL) \ 941 # define BOOST_FOREACH_SHOULD_COPY(COL) \ 942 (true ? 0 : boost::foreach_detail_::or_( \ 943 BOOST_FOREACH_IS_RVALUE(COL) \ 944 , BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL))) 946 #elif defined(BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION) 952 # define BOOST_FOREACH_PREAMBLE() \ 953 BOOST_FOREACH_SUPPRESS_WARNINGS() \ 954 if (bool BOOST_FOREACH_ID(_foreach_is_rvalue) = false) {} else 957 # define BOOST_FOREACH_EVALUATE(COL) \ 958 (true ? boost::foreach_detail_::make_probe((COL), BOOST_FOREACH_ID(_foreach_is_rvalue)) : (COL)) 963 # define BOOST_FOREACH_SHOULD_COPY(COL) \ 964 (boost::foreach_detail_::should_copy_impl( \ 965 true ? 0 : boost::foreach_detail_::or_( \ 966 boost::foreach_detail_::is_array_(COL) \ 967 , BOOST_FOREACH_IS_NONCOPYABLE(COL) \ 968 , boost::foreach_detail_::not_(boost::foreach_detail_::is_const_(COL))) \ 969 , true ? 0 : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL) \ 970 , &BOOST_FOREACH_ID(_foreach_is_rvalue))) 972 #elif !defined(BOOST_FOREACH_NO_RVALUE_DETECTION) 978 # define BOOST_FOREACH_PREAMBLE() \ 979 BOOST_FOREACH_SUPPRESS_WARNINGS() 982 # define BOOST_FOREACH_EVALUATE(COL) \ 987 # define BOOST_FOREACH_SHOULD_COPY(COL) \ 988 (true ? 0 : boost::foreach_detail_::or_( \ 989 boost::foreach_detail_::is_rvalue_((COL), 0) \ 990 , BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL))) 998 # define BOOST_FOREACH_PREAMBLE() \ 999 BOOST_FOREACH_SUPPRESS_WARNINGS() 1002 # define BOOST_FOREACH_EVALUATE(COL) \ 1006 # define BOOST_FOREACH_SHOULD_COPY(COL) \ 1007 (true ? 0 : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL)) 1011 #define BOOST_FOREACH_CONTAIN(COL) \ 1012 boost::foreach_detail_::contain( \ 1013 BOOST_FOREACH_EVALUATE(COL) \ 1014 , BOOST_FOREACH_SHOULD_COPY(COL)) 1016 #define BOOST_FOREACH_BEGIN(COL) \ 1017 boost::foreach_detail_::begin( \ 1018 BOOST_FOREACH_ID(_foreach_col) \ 1019 , BOOST_FOREACH_TYPEOF(COL) \ 1020 , BOOST_FOREACH_SHOULD_COPY(COL)) 1022 #define BOOST_FOREACH_END(COL) \ 1023 boost::foreach_detail_::end( \ 1024 BOOST_FOREACH_ID(_foreach_col) \ 1025 , BOOST_FOREACH_TYPEOF(COL) \ 1026 , BOOST_FOREACH_SHOULD_COPY(COL)) 1028 #define BOOST_FOREACH_DONE(COL) \ 1029 boost::foreach_detail_::done( \ 1030 BOOST_FOREACH_ID(_foreach_cur) \ 1031 , BOOST_FOREACH_ID(_foreach_end) \ 1032 , BOOST_FOREACH_TYPEOF(COL)) 1034 #define BOOST_FOREACH_NEXT(COL) \ 1035 boost::foreach_detail_::next( \ 1036 BOOST_FOREACH_ID(_foreach_cur) \ 1037 , BOOST_FOREACH_TYPEOF(COL)) 1039 #define BOOST_FOREACH_DEREF(COL) \ 1040 boost::foreach_detail_::deref( \ 1041 BOOST_FOREACH_ID(_foreach_cur) \ 1042 , BOOST_FOREACH_TYPEOF(COL)) 1044 #define BOOST_FOREACH_RBEGIN(COL) \ 1045 boost::foreach_detail_::rbegin( \ 1046 BOOST_FOREACH_ID(_foreach_col) \ 1047 , BOOST_FOREACH_TYPEOF(COL) \ 1048 , BOOST_FOREACH_SHOULD_COPY(COL)) 1050 #define BOOST_FOREACH_REND(COL) \ 1051 boost::foreach_detail_::rend( \ 1052 BOOST_FOREACH_ID(_foreach_col) \ 1053 , BOOST_FOREACH_TYPEOF(COL) \ 1054 , BOOST_FOREACH_SHOULD_COPY(COL)) 1056 #define BOOST_FOREACH_RDONE(COL) \ 1057 boost::foreach_detail_::rdone( \ 1058 BOOST_FOREACH_ID(_foreach_cur) \ 1059 , BOOST_FOREACH_ID(_foreach_end) \ 1060 , BOOST_FOREACH_TYPEOF(COL)) 1062 #define BOOST_FOREACH_RNEXT(COL) \ 1063 boost::foreach_detail_::rnext( \ 1064 BOOST_FOREACH_ID(_foreach_cur) \ 1065 , BOOST_FOREACH_TYPEOF(COL)) 1067 #define BOOST_FOREACH_RDEREF(COL) \ 1068 boost::foreach_detail_::rderef( \ 1069 BOOST_FOREACH_ID(_foreach_cur) \ 1070 , BOOST_FOREACH_TYPEOF(COL)) 1098 #define BOOST_FOREACH(VAR, COL) \ 1099 BOOST_FOREACH_PREAMBLE() \ 1100 if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_col) = BOOST_FOREACH_CONTAIN(COL)) {} else \ 1101 if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_cur) = BOOST_FOREACH_BEGIN(COL)) {} else \ 1102 if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_end) = BOOST_FOREACH_END(COL)) {} else \ 1103 for (bool BOOST_FOREACH_ID(_foreach_continue) = true; \ 1104 BOOST_FOREACH_ID(_foreach_continue) && !BOOST_FOREACH_DONE(COL); \ 1105 BOOST_FOREACH_ID(_foreach_continue) ? BOOST_FOREACH_NEXT(COL) : (void)0) \ 1106 if (boost::foreach_detail_::set_false(BOOST_FOREACH_ID(_foreach_continue))) {} else \ 1107 for (VAR = BOOST_FOREACH_DEREF(COL); !BOOST_FOREACH_ID(_foreach_continue); BOOST_FOREACH_ID(_foreach_continue) = true) 1116 #define BOOST_REVERSE_FOREACH(VAR, COL) \ 1117 BOOST_FOREACH_PREAMBLE() \ 1118 if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_col) = BOOST_FOREACH_CONTAIN(COL)) {} else \ 1119 if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_cur) = BOOST_FOREACH_RBEGIN(COL)) {} else \ 1120 if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_end) = BOOST_FOREACH_REND(COL)) {} else \ 1121 for (bool BOOST_FOREACH_ID(_foreach_continue) = true; \ 1122 BOOST_FOREACH_ID(_foreach_continue) && !BOOST_FOREACH_RDONE(COL); \ 1123 BOOST_FOREACH_ID(_foreach_continue) ? BOOST_FOREACH_RNEXT(COL) : (void)0) \ 1124 if (boost::foreach_detail_::set_false(BOOST_FOREACH_ID(_foreach_continue))) {} else \ 1125 for (VAR = BOOST_FOREACH_RDEREF(COL); !BOOST_FOREACH_ID(_foreach_continue); BOOST_FOREACH_ID(_foreach_continue) = true)
BOOST_FORCEINLINE T * addressof(T &v)
GLboolean GLboolean GLboolean b
bool rdone(auto_any_t cur, auto_any_t end, type2type< T, C > *)
wrap_cstr< wchar_t * > type
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
BOOST_DEDUCED_TYPENAME boost::mpl::if_< C, T const, T >::type & auto_any_cast(auto_any_t a)
boost::mpl::or_< Bool1, Bool2, Bool3 > * or_(Bool1 *, Bool2 *, Bool3 *)
boost_foreach_argument_dependent_lookup_hack
#define BOOST_FOREACH_TAG_DEFAULT
boost::is_array< T > * is_array_(T const &)
#define BOOST_FOREACH_DEREFOF(T)
#define BOOST_MPL_ASSERT_MSG(c, msg, types_)
boost::is_rvalue_reference< T && > * is_rvalue_(T &&, int)
BOOST_DEDUCED_TYPENAME foreach_reference< T, C >::type rderef(auto_any_t cur, type2type< T, C > *)
boost::foreach::is_noncopyable< T > * boost_foreach_is_noncopyable(T *&, BOOST_FOREACH_TAG_DEFAULT)
GLboolean GLboolean GLboolean GLboolean a
wrap_cstr< char const * > type
char const * const_iterator
boost::mpl::true_ * is_const_(T const &)
BOOST_DEDUCED_TYPENAME wrap_cstr< T >::type container
wchar_t const * const_iterator
#define BOOST_DEDUCED_TYPENAME
boost::foreach::is_lightweight_proxy< T > * boost_foreach_is_lightweight_proxy(T *&, BOOST_FOREACH_TAG_DEFAULT)
BOOST_DEDUCED_TYPENAME range_reverse_iterator< C >::type rbegin(C &c)
BOOST_DEDUCED_TYPENAME foreach_reference< T, C >::type deref(auto_any_t cur, type2type< T, C > *)
type2type< T, const_ > * encode_type(T const &, boost::mpl::true_ *)
auto_any< int > end(auto_any_t, type2type< T *, C > *, boost::mpl::true_ *)
std::pair< T, T > in_range(T begin, T end)
auto_any< T * > begin(auto_any_t col, type2type< T *, C > *, boost::mpl::true_ *)
auto_any_base const & auto_any_t
void rnext(auto_any_t cur, type2type< T, C > *)
boost::mpl::not_< Bool1 > * not_(Bool1 *)
BOOST_DEDUCED_TYPENAME range_reverse_iterator< C >::type rend(C &c)
wrap_cstr< wchar_t const * > type
BOOST_DEDUCED_TYPENAME wrap_cstr< T >::type container
BOOST_DEDUCED_TYPENAME boost::mpl::eval_if< C, range_const_iterator< container >, range_mutable_iterator< container > >::type type
boost::mpl::and_< Bool1, Bool2, Bool3 > * and_(Bool1 *, Bool2 *, Bool3 *)
BOOST_DEDUCED_TYPENAME boost::mpl::eval_if< C, range_reverse_iterator< container const >, range_reverse_iterator< container > >::type type
auto_any< T * > contain(T &t, boost::mpl::false_ *)