|
|
|
@ -37,7 +37,6 @@
|
|
|
|
|
|
|
|
|
|
#include "boost/type_traits/cv_traits.hpp"
|
|
|
|
|
#include "boost/type_traits/function_traits.hpp"
|
|
|
|
|
#include "boost/utility/swap.hpp"
|
|
|
|
|
|
|
|
|
|
#include "boost/detail/workaround.hpp" // needed for BOOST_WORKAROUND
|
|
|
|
|
|
|
|
|
@ -87,28 +86,45 @@ namespace detail {
|
|
|
|
|
template<class T>
|
|
|
|
|
class generate_error;
|
|
|
|
|
|
|
|
|
|
template<int N>
|
|
|
|
|
struct drop_front {
|
|
|
|
|
template<class Tuple>
|
|
|
|
|
struct apply {
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME drop_front<N-1>::BOOST_NESTED_TEMPLATE
|
|
|
|
|
apply<Tuple> next;
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME next::type::tail_type type;
|
|
|
|
|
static const type& call(const Tuple& tup) {
|
|
|
|
|
return next::call(tup).tail;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
// - cons getters --------------------------------------------------------
|
|
|
|
|
// called: get_class<N>::get<RETURN_TYPE>(aTuple)
|
|
|
|
|
|
|
|
|
|
template< int N >
|
|
|
|
|
struct get_class {
|
|
|
|
|
template<class RET, class HT, class TT >
|
|
|
|
|
inline static RET get(const cons<HT, TT>& t)
|
|
|
|
|
{
|
|
|
|
|
#if BOOST_WORKAROUND(__IBMCPP__,==600)
|
|
|
|
|
// vacpp 6.0 is not very consistent regarding the member template keyword
|
|
|
|
|
// Here it generates an error when the template keyword is used.
|
|
|
|
|
return get_class<N-1>::get<RET>(t.tail);
|
|
|
|
|
#else
|
|
|
|
|
return get_class<N-1>::BOOST_NESTED_TEMPLATE get<RET>(t.tail);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
template<class RET, class HT, class TT >
|
|
|
|
|
inline static RET get(cons<HT, TT>& t)
|
|
|
|
|
{
|
|
|
|
|
#if BOOST_WORKAROUND(__IBMCPP__,==600)
|
|
|
|
|
return get_class<N-1>::get<RET>(t.tail);
|
|
|
|
|
#else
|
|
|
|
|
return get_class<N-1>::BOOST_NESTED_TEMPLATE get<RET>(t.tail);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
struct drop_front<0> {
|
|
|
|
|
template<class Tuple>
|
|
|
|
|
struct apply {
|
|
|
|
|
typedef Tuple type;
|
|
|
|
|
static const type& call(const Tuple& tup) {
|
|
|
|
|
return tup;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
struct get_class<0> {
|
|
|
|
|
template<class RET, class HT, class TT>
|
|
|
|
|
inline static RET get(const cons<HT, TT>& t)
|
|
|
|
|
{
|
|
|
|
|
return t.head;
|
|
|
|
|
}
|
|
|
|
|
template<class RET, class HT, class TT>
|
|
|
|
|
inline static RET get(cons<HT, TT>& t)
|
|
|
|
|
{
|
|
|
|
|
return t.head;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // end of namespace detail
|
|
|
|
@ -124,23 +140,41 @@ struct drop_front<0> {
|
|
|
|
|
template<int N, class T>
|
|
|
|
|
struct element
|
|
|
|
|
{
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
|
|
|
|
apply<T>::type::head_type type;
|
|
|
|
|
private:
|
|
|
|
|
typedef typename T::tail_type Next;
|
|
|
|
|
public:
|
|
|
|
|
typedef typename element<N-1, Next>::type type;
|
|
|
|
|
};
|
|
|
|
|
template<class T>
|
|
|
|
|
struct element<0,T>
|
|
|
|
|
{
|
|
|
|
|
typedef typename T::head_type type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<int N, class T>
|
|
|
|
|
struct element<N, const T>
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
|
|
|
|
apply<T>::type::head_type unqualified_type;
|
|
|
|
|
typedef typename T::tail_type Next;
|
|
|
|
|
typedef typename element<N-1, Next>::type unqualified_type;
|
|
|
|
|
public:
|
|
|
|
|
#if BOOST_WORKAROUND(__BORLANDC__,<0x600)
|
|
|
|
|
typedef const unqualified_type type;
|
|
|
|
|
#else
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME boost::add_const<unqualified_type>::type type;
|
|
|
|
|
typedef typename boost::add_const<unqualified_type>::type type;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
template<class T>
|
|
|
|
|
struct element<0,const T>
|
|
|
|
|
{
|
|
|
|
|
#if BOOST_WORKAROUND(__BORLANDC__,<0x600)
|
|
|
|
|
typedef const typename T::head_type type;
|
|
|
|
|
#else
|
|
|
|
|
typedef typename boost::add_const<typename T::head_type>::type type;
|
|
|
|
|
#endif
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#else // def BOOST_NO_CV_SPECIALIZATIONS
|
|
|
|
|
|
|
|
|
|
namespace detail {
|
|
|
|
@ -148,16 +182,31 @@ namespace detail {
|
|
|
|
|
template<int N, class T, bool IsConst>
|
|
|
|
|
struct element_impl
|
|
|
|
|
{
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
|
|
|
|
apply<T>::type::head_type type;
|
|
|
|
|
private:
|
|
|
|
|
typedef typename T::tail_type Next;
|
|
|
|
|
public:
|
|
|
|
|
typedef typename element_impl<N-1, Next, IsConst>::type type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<int N, class T>
|
|
|
|
|
struct element_impl<N, T, true /* IsConst */>
|
|
|
|
|
{
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
|
|
|
|
apply<T>::type::head_type unqualified_type;
|
|
|
|
|
typedef const unqualified_type type;
|
|
|
|
|
private:
|
|
|
|
|
typedef typename T::tail_type Next;
|
|
|
|
|
public:
|
|
|
|
|
typedef const typename element_impl<N-1, Next, true>::type type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
|
struct element_impl<0, T, false /* IsConst */>
|
|
|
|
|
{
|
|
|
|
|
typedef typename T::head_type type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
|
struct element_impl<0, T, true /* IsConst */>
|
|
|
|
|
{
|
|
|
|
|
typedef const typename T::head_type type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // end of namespace detail
|
|
|
|
@ -209,10 +258,17 @@ inline typename access_traits<
|
|
|
|
|
typename element<N, cons<HT, TT> >::type
|
|
|
|
|
>::non_const_type
|
|
|
|
|
get(cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
|
|
|
|
apply<cons<HT, TT> > impl;
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
|
|
|
|
|
return const_cast<cons_element&>(impl::call(c)).head;
|
|
|
|
|
#if BOOST_WORKAROUND(__IBMCPP__,==600 )
|
|
|
|
|
return detail::get_class<N>::
|
|
|
|
|
#else
|
|
|
|
|
return detail::get_class<N>::BOOST_NESTED_TEMPLATE
|
|
|
|
|
#endif
|
|
|
|
|
get<
|
|
|
|
|
typename access_traits<
|
|
|
|
|
typename element<N, cons<HT, TT> >::type
|
|
|
|
|
>::non_const_type,
|
|
|
|
|
HT,TT
|
|
|
|
|
>(c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get function for const cons-lists, returns a const reference to
|
|
|
|
@ -223,10 +279,17 @@ inline typename access_traits<
|
|
|
|
|
typename element<N, cons<HT, TT> >::type
|
|
|
|
|
>::const_type
|
|
|
|
|
get(const cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
|
|
|
|
apply<cons<HT, TT> > impl;
|
|
|
|
|
typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
|
|
|
|
|
return impl::call(c).head;
|
|
|
|
|
#if BOOST_WORKAROUND(__IBMCPP__,==600)
|
|
|
|
|
return detail::get_class<N>::
|
|
|
|
|
#else
|
|
|
|
|
return detail::get_class<N>::BOOST_NESTED_TEMPLATE
|
|
|
|
|
#endif
|
|
|
|
|
get<
|
|
|
|
|
typename access_traits<
|
|
|
|
|
typename element<N, cons<HT, TT> >::type
|
|
|
|
|
>::const_type,
|
|
|
|
|
HT,TT
|
|
|
|
|
>(c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -- the cons template --------------------------------------------------
|
|
|
|
@ -600,21 +663,18 @@ public:
|
|
|
|
|
// Swallows any assignment (by Doug Gregor)
|
|
|
|
|
namespace detail {
|
|
|
|
|
|
|
|
|
|
struct swallow_assign;
|
|
|
|
|
typedef void (detail::swallow_assign::*ignore_t)();
|
|
|
|
|
struct swallow_assign {
|
|
|
|
|
swallow_assign(ignore_t(*)(ignore_t)) {}
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
|
swallow_assign const& operator=(const T&) const {
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace detail
|
|
|
|
|
|
|
|
|
|
// "ignore" allows tuple positions to be ignored when using "tie".
|
|
|
|
|
inline detail::ignore_t ignore(detail::ignore_t) { return 0; }
|
|
|
|
|
detail::swallow_assign const ignore = detail::swallow_assign();
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
// The call_traits for make_tuple
|
|
|
|
@ -696,10 +756,6 @@ struct make_tuple_traits<const reference_wrapper<T> >{
|
|
|
|
|
typedef T& type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
struct make_tuple_traits<detail::ignore_t(detail::ignore_t)> {
|
|
|
|
|
typedef detail::swallow_assign type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -821,154 +877,71 @@ make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
|
|
|
|
|
return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace detail {
|
|
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
|
struct tie_traits {
|
|
|
|
|
typedef T& type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
struct tie_traits<ignore_t(ignore_t)> {
|
|
|
|
|
typedef swallow_assign type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
struct tie_traits<void> {
|
|
|
|
|
typedef null_type type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <
|
|
|
|
|
class T0 = void, class T1 = void, class T2 = void,
|
|
|
|
|
class T3 = void, class T4 = void, class T5 = void,
|
|
|
|
|
class T6 = void, class T7 = void, class T8 = void,
|
|
|
|
|
class T9 = void
|
|
|
|
|
>
|
|
|
|
|
struct tie_mapper {
|
|
|
|
|
typedef
|
|
|
|
|
tuple<typename tie_traits<T0>::type,
|
|
|
|
|
typename tie_traits<T1>::type,
|
|
|
|
|
typename tie_traits<T2>::type,
|
|
|
|
|
typename tie_traits<T3>::type,
|
|
|
|
|
typename tie_traits<T4>::type,
|
|
|
|
|
typename tie_traits<T5>::type,
|
|
|
|
|
typename tie_traits<T6>::type,
|
|
|
|
|
typename tie_traits<T7>::type,
|
|
|
|
|
typename tie_traits<T8>::type,
|
|
|
|
|
typename tie_traits<T9>::type> type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tie function templates -------------------------------------------------
|
|
|
|
|
template<class T0>
|
|
|
|
|
inline typename detail::tie_mapper<T0>::type
|
|
|
|
|
tie(T0& t0) {
|
|
|
|
|
typedef typename detail::tie_mapper<T0>::type t;
|
|
|
|
|
return t(t0);
|
|
|
|
|
template<class T1>
|
|
|
|
|
inline tuple<T1&> tie(T1& t1) {
|
|
|
|
|
return tuple<T1&> (t1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class T0, class T1>
|
|
|
|
|
inline typename detail::tie_mapper<T0, T1>::type
|
|
|
|
|
tie(T0& t0, T1& t1) {
|
|
|
|
|
typedef typename detail::tie_mapper<T0, T1>::type t;
|
|
|
|
|
return t(t0, t1);
|
|
|
|
|
template<class T1, class T2>
|
|
|
|
|
inline tuple<T1&, T2&> tie(T1& t1, T2& t2) {
|
|
|
|
|
return tuple<T1&, T2&> (t1, t2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class T0, class T1, class T2>
|
|
|
|
|
inline typename detail::tie_mapper<T0, T1, T2>::type
|
|
|
|
|
tie(T0& t0, T1& t1, T2& t2) {
|
|
|
|
|
typedef typename detail::tie_mapper<T0, T1, T2>::type t;
|
|
|
|
|
return t(t0, t1, t2);
|
|
|
|
|
template<class T1, class T2, class T3>
|
|
|
|
|
inline tuple<T1&, T2&, T3&> tie(T1& t1, T2& t2, T3& t3) {
|
|
|
|
|
return tuple<T1&, T2&, T3&> (t1, t2, t3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class T0, class T1, class T2, class T3>
|
|
|
|
|
inline typename detail::tie_mapper<T0, T1, T2, T3>::type
|
|
|
|
|
tie(T0& t0, T1& t1, T2& t2, T3& t3) {
|
|
|
|
|
typedef typename detail::tie_mapper<T0, T1, T2, T3>::type t;
|
|
|
|
|
return t(t0, t1, t2, t3);
|
|
|
|
|
template<class T1, class T2, class T3, class T4>
|
|
|
|
|
inline tuple<T1&, T2&, T3&, T4&> tie(T1& t1, T2& t2, T3& t3, T4& t4) {
|
|
|
|
|
return tuple<T1&, T2&, T3&, T4&> (t1, t2, t3, t4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class T0, class T1, class T2, class T3, class T4>
|
|
|
|
|
inline typename detail::tie_mapper<T0, T1, T2, T3, T4>::type
|
|
|
|
|
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
|
|
|
|
T4& t4) {
|
|
|
|
|
typedef typename detail::tie_mapper<T0, T1, T2, T3, T4>::type t;
|
|
|
|
|
return t(t0, t1, t2, t3, t4);
|
|
|
|
|
template<class T1, class T2, class T3, class T4, class T5>
|
|
|
|
|
inline tuple<T1&, T2&, T3&, T4&, T5&>
|
|
|
|
|
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5) {
|
|
|
|
|
return tuple<T1&, T2&, T3&, T4&, T5&> (t1, t2, t3, t4, t5);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class T0, class T1, class T2, class T3, class T4, class T5>
|
|
|
|
|
inline typename detail::tie_mapper<T0, T1, T2, T3, T4, T5>::type
|
|
|
|
|
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
|
|
|
|
T4& t4, T5& t5) {
|
|
|
|
|
typedef typename detail::tie_mapper<T0, T1, T2, T3, T4, T5>::type t;
|
|
|
|
|
return t(t0, t1, t2, t3, t4, t5);
|
|
|
|
|
template<class T1, class T2, class T3, class T4, class T5, class T6>
|
|
|
|
|
inline tuple<T1&, T2&, T3&, T4&, T5&, T6&>
|
|
|
|
|
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6) {
|
|
|
|
|
return tuple<T1&, T2&, T3&, T4&, T5&, T6&> (t1, t2, t3, t4, t5, t6);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6>
|
|
|
|
|
inline typename detail::tie_mapper<T0, T1, T2, T3, T4, T5, T6>::type
|
|
|
|
|
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
|
|
|
|
T4& t4, T5& t5, T6& t6) {
|
|
|
|
|
typedef typename detail::tie_mapper
|
|
|
|
|
<T0, T1, T2, T3, T4, T5, T6>::type t;
|
|
|
|
|
return t(t0, t1, t2, t3, t4, t5, t6);
|
|
|
|
|
template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
|
|
|
|
|
inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&>
|
|
|
|
|
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7) {
|
|
|
|
|
return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&> (t1, t2, t3, t4, t5, t6, t7);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
|
|
|
|
|
class T7>
|
|
|
|
|
inline typename detail::tie_mapper<T0, T1, T2, T3, T4, T5, T6, T7>::type
|
|
|
|
|
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
|
|
|
|
T4& t4, T5& t5, T6& t6, T7& t7) {
|
|
|
|
|
typedef typename detail::tie_mapper
|
|
|
|
|
<T0, T1, T2, T3, T4, T5, T6, T7>::type t;
|
|
|
|
|
return t(t0, t1, t2, t3, t4, t5, t6, t7);
|
|
|
|
|
template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
|
|
|
|
|
class T8>
|
|
|
|
|
inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&>
|
|
|
|
|
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8) {
|
|
|
|
|
return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&>
|
|
|
|
|
(t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
|
|
|
|
|
class T7, class T8>
|
|
|
|
|
inline typename detail::tie_mapper
|
|
|
|
|
<T0, T1, T2, T3, T4, T5, T6, T7, T8>::type
|
|
|
|
|
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
|
|
|
|
T4& t4, T5& t5, T6& t6, T7& t7,
|
|
|
|
|
T8& t8) {
|
|
|
|
|
typedef typename detail::tie_mapper
|
|
|
|
|
<T0, T1, T2, T3, T4, T5, T6, T7, T8>::type t;
|
|
|
|
|
return t(t0, t1, t2, t3, t4, t5, t6, t7, t8);
|
|
|
|
|
template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
|
|
|
|
|
class T8, class T9>
|
|
|
|
|
inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&>
|
|
|
|
|
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8,
|
|
|
|
|
T9& t9) {
|
|
|
|
|
return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&>
|
|
|
|
|
(t1, t2, t3, t4, t5, t6, t7, t8, t9);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
|
|
|
|
|
class T7, class T8, class T9>
|
|
|
|
|
inline typename detail::tie_mapper
|
|
|
|
|
<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
|
|
|
|
|
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
|
|
|
|
T4& t4, T5& t5, T6& t6, T7& t7,
|
|
|
|
|
T8& t8, T9& t9) {
|
|
|
|
|
typedef typename detail::tie_mapper
|
|
|
|
|
<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type t;
|
|
|
|
|
return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <class T0, class T1, class T2, class T3, class T4,
|
|
|
|
|
class T5, class T6, class T7, class T8, class T9>
|
|
|
|
|
void swap(tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& lhs,
|
|
|
|
|
tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& rhs);
|
|
|
|
|
inline void swap(null_type&, null_type&) {}
|
|
|
|
|
template<class HH>
|
|
|
|
|
inline void swap(cons<HH, null_type>& lhs, cons<HH, null_type>& rhs) {
|
|
|
|
|
::boost::swap(lhs.head, rhs.head);
|
|
|
|
|
}
|
|
|
|
|
template<class HH, class TT>
|
|
|
|
|
inline void swap(cons<HH, TT>& lhs, cons<HH, TT>& rhs) {
|
|
|
|
|
::boost::swap(lhs.head, rhs.head);
|
|
|
|
|
::boost::tuples::swap(lhs.tail, rhs.tail);
|
|
|
|
|
}
|
|
|
|
|
template <class T0, class T1, class T2, class T3, class T4,
|
|
|
|
|
class T5, class T6, class T7, class T8, class T9>
|
|
|
|
|
inline void swap(tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& lhs,
|
|
|
|
|
tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& rhs) {
|
|
|
|
|
typedef tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> tuple_type;
|
|
|
|
|
typedef typename tuple_type::inherited base;
|
|
|
|
|
::boost::tuples::swap(static_cast<base&>(lhs), static_cast<base&>(rhs));
|
|
|
|
|
template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
|
|
|
|
|
class T8, class T9, class T10>
|
|
|
|
|
inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&, T10&>
|
|
|
|
|
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8,
|
|
|
|
|
T9& t9, T10& t10) {
|
|
|
|
|
return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&, T10&>
|
|
|
|
|
(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // end of namespace tuples
|
|
|
|
|