File indexing completed on 2025-01-18 09:29:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_ASSIGN_LIST_OF_HPP
0013 #define BOOST_ASSIGN_LIST_OF_HPP
0014
0015 #if defined(_MSC_VER)
0016 # pragma once
0017 #endif
0018
0019 #include <boost/assign/assignment_exception.hpp>
0020 #include <boost/range/iterator_range.hpp>
0021 #include <boost/config.hpp>
0022 #include <boost/tuple/tuple.hpp>
0023 #include <boost/type_traits/remove_const.hpp>
0024 #include <boost/type_traits/remove_reference.hpp>
0025 #include <boost/type_traits/is_reference.hpp>
0026 #include <boost/static_assert.hpp>
0027 #include <boost/throw_exception.hpp>
0028 #include <boost/type_traits/conditional.hpp>
0029 #include <boost/type_traits/detail/yes_no_type.hpp>
0030 #include <boost/type_traits/decay.hpp>
0031 #include <boost/type_traits/is_array.hpp>
0032 #include <boost/utility/enable_if.hpp>
0033 #include <boost/utility/declval.hpp>
0034 #include <boost/move/utility.hpp>
0035 #include <deque>
0036 #include <cstddef>
0037 #include <utility>
0038 #ifndef BOOST_NO_CXX11_HDR_ARRAY
0039 #include <array>
0040 #endif
0041 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
0042 #include <initializer_list>
0043 #endif
0044
0045
0046 #if !(defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || BOOST_WORKAROUND(BOOST_GCC, < 40700) \
0047 || defined(BOOST_NO_CXX11_RVALUE_REFERENCES))
0048 # define BOOST_ASSIGN_USE_VARIADIC_TEMPLATES
0049 #endif
0050
0051 #if !defined(BOOST_ASSIGN_USE_VARIADIC_TEMPLATES)
0052
0053 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
0054 #include <boost/preprocessor/repetition/enum_params.hpp>
0055 #include <boost/preprocessor/iteration/local.hpp>
0056
0057 #endif
0058
0059 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0060
0061 #include <boost/array.hpp>
0062 #endif
0063
0064 namespace boost
0065 {
0066
0067
0068 #if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0069 template< class T, std::size_t sz >
0070 class array;
0071 #endif
0072
0073 namespace assign_detail
0074 {
0075
0076
0077
0078
0079 template< class T >
0080 struct assign_decay
0081 {
0082
0083
0084
0085
0086 typedef BOOST_DEDUCED_TYPENAME ::boost::conditional<
0087 ::boost::is_array<T>::value,
0088 ::boost::decay<const T>,
0089 ::boost::decay<T> >::type::type type;
0090 };
0091
0092 template< class T, std::size_t sz >
0093 type_traits::yes_type assign_is_array( const array<T,sz>* );
0094 #ifndef BOOST_NO_CXX11_HDR_ARRAY
0095 template< class T, std::size_t sz >
0096 type_traits::yes_type assign_is_array( const std::array<T, sz>* );
0097 #endif
0098 type_traits::no_type assign_is_array( ... );
0099 template< class T, class U >
0100 type_traits::yes_type assign_is_pair( const std::pair<T,U>* );
0101 type_traits::no_type assign_is_pair( ... );
0102
0103
0104
0105 struct array_type_tag
0106 {
0107 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0108 private:
0109 char dummy_;
0110 #endif
0111 };
0112 struct adapter_type_tag
0113 {
0114 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0115 private:
0116 char dummy_;
0117 #endif
0118 };
0119 struct pair_type_tag
0120 {
0121 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0122 private:
0123 char dummy_;
0124 #endif
0125 };
0126 struct default_type_tag
0127 {
0128 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0129 private:
0130 char dummy_;
0131 #endif
0132 };
0133
0134 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
0135 template< class C >
0136 struct is_initializer_list : boost::false_type {};
0137
0138 template< class E >
0139 struct is_initializer_list< std::initializer_list<E> > : boost::true_type {};
0140 #endif
0141
0142 template< class DerivedTAssign, class Iterator >
0143 class converter
0144 {
0145 public:
0146 typedef Iterator iterator;
0147 typedef Iterator const_iterator;
0148
0149 iterator begin() const
0150 {
0151 return static_cast<const DerivedTAssign*>(this)->begin();
0152 }
0153
0154 iterator end() const
0155 {
0156 return static_cast<const DerivedTAssign*>(this)->end();
0157 }
0158
0159 public:
0160
0161 template< class Container >
0162 Container convert_to_container() const
0163 {
0164 static Container* c = 0;
0165 BOOST_STATIC_CONSTANT( bool, is_array_flag = sizeof( assign_detail::assign_is_array( c ) )
0166 == sizeof( type_traits::yes_type ) );
0167
0168 typedef BOOST_DEDUCED_TYPENAME ::boost::conditional< is_array_flag,
0169 array_type_tag,
0170 default_type_tag >::type tag_type;
0171
0172 return convert<Container>( c, tag_type() );
0173 }
0174
0175 private:
0176
0177 template< class Container >
0178 Container convert( const Container*, default_type_tag ) const
0179 {
0180
0181 #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
0182
0183 Container result;
0184 iterator it = begin(),
0185 e = end();
0186 while( it != e )
0187 {
0188 result.insert( result.end(), *it );
0189 ++it;
0190 }
0191 return result;
0192 #else
0193 return Container( begin(), end() );
0194 #endif
0195 }
0196
0197 template< class Array >
0198 Array convert( const Array*, array_type_tag ) const
0199 {
0200 typedef BOOST_DEDUCED_TYPENAME Array::value_type value_type;
0201
0202 #if BOOST_WORKAROUND(BOOST_INTEL, <= 910 ) || BOOST_WORKAROUND(__SUNPRO_CC, <= 0x5100 )
0203 BOOST_DEDUCED_TYPENAME remove_const<Array>::type ar;
0204 #else
0205 Array ar;
0206 #endif
0207 const std::size_t sz = ar.size();
0208 if( sz < static_cast<const DerivedTAssign*>(this)->size() )
0209 BOOST_THROW_EXCEPTION( assign::assignment_exception( "array initialized with too many elements" ) );
0210 std::size_t n = 0;
0211 iterator i = begin(),
0212 e = end();
0213 for( ; i != e; ++i, ++n )
0214 ar[n] = *i;
0215 for( ; n < sz; ++n )
0216 ar[n] = value_type();
0217 return ar;
0218 }
0219
0220 template< class Adapter >
0221 Adapter convert_to_adapter( const Adapter* = 0 ) const
0222 {
0223 Adapter a;
0224 iterator i = begin(),
0225 e = end();
0226 for( ; i != e; ++i )
0227 a.push( *i );
0228 return a;
0229 }
0230
0231 private:
0232 struct adapter_converter;
0233 friend struct adapter_converter;
0234
0235 struct adapter_converter
0236 {
0237 const converter& gl;
0238 adapter_converter( const converter& this_ ) : gl( this_ )
0239 {}
0240
0241 adapter_converter( const adapter_converter& r )
0242 : gl( r.gl )
0243 { }
0244
0245 template< class Adapter >
0246 operator Adapter() const
0247 {
0248 return gl.convert_to_adapter<Adapter>();
0249 }
0250 };
0251
0252 public:
0253 template< class Container >
0254 Container to_container( Container& c ) const
0255 {
0256 return convert( &c, default_type_tag() );
0257 }
0258
0259 adapter_converter to_adapter() const
0260 {
0261 return adapter_converter( *this );
0262 }
0263
0264 template< class Adapter >
0265 Adapter to_adapter( Adapter& a ) const
0266 {
0267 return this->convert_to_adapter( &a );
0268 }
0269
0270 template< class Array >
0271 Array to_array( Array& a ) const
0272 {
0273 return convert( &a, array_type_tag() );
0274 }
0275 };
0276
0277 template< class T, class I, class Range >
0278 inline bool operator==( const converter<T,I>& l, const Range& r )
0279 {
0280 return ::boost::iterator_range_detail::equal( l, r );
0281 }
0282
0283 template< class T, class I, class Range >
0284 inline bool operator==( const Range& l, const converter<T,I>& r )
0285 {
0286 return r == l;
0287 }
0288
0289 template< class T, class I, class Range >
0290 inline bool operator!=( const converter<T,I>& l, const Range& r )
0291 {
0292 return !( l == r );
0293 }
0294
0295 template< class T, class I, class Range >
0296 inline bool operator!=( const Range& l, const converter<T,I>& r )
0297 {
0298 return !( l == r );
0299 }
0300
0301 template< class T, class I, class Range >
0302 inline bool operator<( const converter<T,I>& l, const Range& r )
0303 {
0304 return ::boost::iterator_range_detail::less_than( l, r );
0305 }
0306
0307 template< class T, class I, class Range >
0308 inline bool operator<( const Range& l, const converter<T,I>& r )
0309 {
0310 return ::boost::iterator_range_detail::less_than( l, r );
0311 }
0312
0313 template< class T, class I, class Range >
0314 inline bool operator>( const converter<T,I>& l, const Range& r )
0315 {
0316 return r < l;
0317 }
0318
0319 template< class T, class I, class Range >
0320 inline bool operator>( const Range& l, const converter<T,I>& r )
0321 {
0322 return r < l;
0323 }
0324
0325 template< class T, class I, class Range >
0326 inline bool operator<=( const converter<T,I>& l, const Range& r )
0327 {
0328 return !( l > r );
0329 }
0330
0331 template< class T, class I, class Range >
0332 inline bool operator<=( const Range& l, const converter<T,I>& r )
0333 {
0334 return !( l > r );
0335 }
0336
0337 template< class T, class I, class Range >
0338 inline bool operator>=( const converter<T,I>& l, const Range& r )
0339 {
0340 return !( l < r );
0341 }
0342
0343 template< class T, class I, class Range >
0344 inline bool operator>=( const Range& l, const converter<T,I>& r )
0345 {
0346 return !( l < r );
0347 }
0348
0349 template< class T, class I, class Elem, class Traits >
0350 inline std::basic_ostream<Elem,Traits>&
0351 operator<<( std::basic_ostream<Elem, Traits>& Os,
0352 const converter<T,I>& r )
0353 {
0354 return Os << ::boost::make_iterator_range( r.begin(), r.end() );
0355 }
0356
0357
0358
0359
0360
0361 template< class T >
0362 class generic_list :
0363 public converter< generic_list< BOOST_DEDUCED_TYPENAME assign_decay<T>::type >,
0364 BOOST_DEDUCED_TYPENAME std::deque<BOOST_DEDUCED_TYPENAME
0365 assign_decay<T>::type>::iterator >
0366 {
0367 typedef BOOST_DEDUCED_TYPENAME assign_decay<T>::type Ty;
0368 typedef std::deque<Ty> impl_type;
0369 mutable impl_type values_;
0370
0371 public:
0372 typedef BOOST_DEDUCED_TYPENAME impl_type::iterator iterator;
0373 typedef iterator const_iterator;
0374 typedef BOOST_DEDUCED_TYPENAME impl_type::value_type value_type;
0375 typedef BOOST_DEDUCED_TYPENAME impl_type::size_type size_type;
0376 typedef BOOST_DEDUCED_TYPENAME impl_type::difference_type difference_type;
0377
0378 public:
0379 iterator begin() const { return values_.begin(); }
0380 iterator end() const { return values_.end(); }
0381 bool empty() const { return values_.empty(); }
0382 size_type size() const { return values_.size(); }
0383
0384 private:
0385 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0386 void push_back( value_type r ) { values_.push_back( r ); }
0387 #else
0388 void push_back( const value_type& r ) { values_.push_back( r ); }
0389 void push_back( value_type&& r ) { values_.push_back( boost::move( r ) ); }
0390 #endif
0391 public:
0392 generic_list& operator,( const Ty& u )
0393 {
0394 this->push_back( u );
0395 return *this;
0396 }
0397
0398 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
0399
0400 generic_list& operator,( Ty&& u )
0401 {
0402 this->push_back( boost::move(u) );
0403 return *this;
0404 }
0405 #endif
0406 generic_list& operator()( const Ty& u )
0407 {
0408 this->push_back( u );
0409 return *this;
0410 }
0411
0412 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
0413
0414 generic_list& operator()(Ty&& u)
0415 {
0416 this->push_back( boost::move(u) );
0417 return *this;
0418 }
0419 #endif
0420
0421 generic_list& operator()()
0422 {
0423 this->push_back( Ty() );
0424 return *this;
0425 }
0426
0427 #if !defined(BOOST_ASSIGN_USE_VARIADIC_TEMPLATES)
0428
0429 #ifndef BOOST_ASSIGN_MAX_PARAMS
0430 #define BOOST_ASSIGN_MAX_PARAMS 5
0431 #endif
0432 #define BOOST_ASSIGN_MAX_PARAMETERS (BOOST_ASSIGN_MAX_PARAMS - 1)
0433 #define BOOST_ASSIGN_PARAMS1(n) BOOST_PP_ENUM_PARAMS(n, class U)
0434 #define BOOST_ASSIGN_PARAMS2(n) BOOST_PP_ENUM_BINARY_PARAMS(n, U, const& u)
0435 #define BOOST_ASSIGN_PARAMS3(n) BOOST_PP_ENUM_PARAMS(n, u)
0436 #define BOOST_ASSIGN_PARAMS4(n) BOOST_PP_ENUM_PARAMS(n, U)
0437 #define BOOST_ASSIGN_PARAMS2_NO_REF(n) BOOST_PP_ENUM_BINARY_PARAMS(n, U, u)
0438
0439 #define BOOST_PP_LOCAL_LIMITS (1, BOOST_ASSIGN_MAX_PARAMETERS)
0440 #define BOOST_PP_LOCAL_MACRO(n) \
0441 template< class U, BOOST_ASSIGN_PARAMS1(n) > \
0442 generic_list& operator()(U const& u, BOOST_ASSIGN_PARAMS2(n) ) \
0443 { \
0444 this->push_back( Ty(u, BOOST_ASSIGN_PARAMS3(n))); \
0445 return *this; \
0446 } \
0447
0448
0449 #include BOOST_PP_LOCAL_ITERATE()
0450
0451 #else
0452 template< class U0, class U1, class... Us >
0453 generic_list& operator()(U0&& u0, U1&& u1, Us&&... us)
0454 {
0455 this->push_back(Ty(boost::forward<U0>(u0), boost::forward<U1>(u1), boost::forward<Us>(us)...));
0456 return *this;
0457 }
0458 #endif
0459
0460 template< class U >
0461 generic_list& repeat( std::size_t sz, U u )
0462 {
0463 std::size_t i = 0;
0464 while( i++ != sz )
0465 this->push_back( u );
0466 return *this;
0467 }
0468
0469 template< class Nullary_function >
0470 generic_list& repeat_fun( std::size_t sz, Nullary_function fun )
0471 {
0472 std::size_t i = 0;
0473 while( i++ != sz )
0474 this->push_back( fun() );
0475 return *this;
0476 }
0477
0478 template< class SinglePassIterator >
0479 generic_list& range( SinglePassIterator first,
0480 SinglePassIterator last )
0481 {
0482 for( ; first != last; ++first )
0483 this->push_back( *first );
0484 return *this;
0485 }
0486
0487 template< class SinglePassRange >
0488 generic_list& range( const SinglePassRange& r )
0489 {
0490 return range( boost::begin(r), boost::end(r) );
0491 }
0492 #if !defined(BOOST_NO_CXX11_DECLTYPE_N3276) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
0493 template< class Container,
0494 class = decltype(Container(
0495 boost::declval<BOOST_DEDUCED_TYPENAME std::deque<BOOST_DEDUCED_TYPENAME assign_decay<T>::type>::iterator>(),
0496 boost::declval<BOOST_DEDUCED_TYPENAME std::deque<BOOST_DEDUCED_TYPENAME assign_decay<T>::type>::iterator>()
0497 ))
0498 >
0499 operator Container() const
0500 {
0501 return this-> BOOST_NESTED_TEMPLATE convert_to_container<Container>();
0502 }
0503
0504 template< class Container,
0505 class = typename boost::enable_if< boost::is_same< boost::type_traits::yes_type, decltype(assign_is_array((Container*)0))> >::type,
0506 class = void
0507 >
0508 operator Container() const
0509 {
0510 return this-> BOOST_NESTED_TEMPLATE convert_to_container<Container>();
0511 }
0512 #elif !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
0513 template< class Container
0514 # if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
0515 , class = typename boost::disable_if< is_initializer_list<Container> >::type
0516 # endif
0517 , class = typename Container::iterator
0518 >
0519 operator Container() const
0520 {
0521 return this-> BOOST_NESTED_TEMPLATE convert_to_container<Container>();
0522 }
0523 #else
0524 template< class Container >
0525 operator Container() const
0526 {
0527 return this-> BOOST_NESTED_TEMPLATE convert_to_container<Container>();
0528 }
0529 #endif
0530 };
0531
0532
0533
0534
0535
0536 template< class T >
0537 struct assign_reference
0538 {
0539 assign_reference() : ref_(0)
0540 { }
0541
0542 assign_reference( T& r ) : ref_(&r)
0543 { }
0544
0545 void operator=( T& r )
0546 {
0547 ref_ = &r;
0548 }
0549
0550 operator T&() const
0551 {
0552 return *ref_;
0553 }
0554
0555 void swap( assign_reference& r )
0556 {
0557 std::swap( *ref_, *r.ref_ );
0558 }
0559
0560 T& get_ref() const
0561 {
0562 return *ref_;
0563 }
0564
0565 private:
0566 T* ref_;
0567
0568 };
0569
0570 template< class T >
0571 inline bool operator<( const assign_reference<T>& l,
0572 const assign_reference<T>& r )
0573 {
0574 return l.get_ref() < r.get_ref();
0575 }
0576
0577 template< class T >
0578 inline bool operator>( const assign_reference<T>& l,
0579 const assign_reference<T>& r )
0580 {
0581 return l.get_ref() > r.get_ref();
0582 }
0583
0584 template< class T >
0585 inline void swap( assign_reference<T>& l,
0586 assign_reference<T>& r )
0587 {
0588 l.swap( r );
0589 }
0590
0591
0592
0593 template< class T, int N >
0594 struct static_generic_list :
0595 public converter< static_generic_list<T,N>, assign_reference<T>* >
0596 {
0597 private:
0598 typedef T internal_value_type;
0599
0600 public:
0601 typedef assign_reference<internal_value_type> value_type;
0602 typedef value_type* iterator;
0603 typedef value_type* const_iterator;
0604 typedef std::size_t size_type;
0605 typedef std::ptrdiff_t difference_type;
0606
0607
0608 static_generic_list( T& r ) :
0609 current_(1)
0610 {
0611 refs_[0] = r;
0612 }
0613
0614 static_generic_list& operator()( T& r )
0615 {
0616 insert( r );
0617 return *this;
0618 }
0619
0620 iterator begin() const
0621 {
0622 return &refs_[0];
0623 }
0624
0625 iterator end() const
0626 {
0627 return &refs_[current_];
0628 }
0629
0630 size_type size() const
0631 {
0632 return static_cast<size_type>( current_ );
0633 }
0634
0635 bool empty() const
0636 {
0637 return false;
0638 }
0639
0640 template< class ForwardIterator >
0641 static_generic_list& range( ForwardIterator first,
0642 ForwardIterator last )
0643 {
0644 for( ; first != last; ++first )
0645 this->insert( *first );
0646 return *this;
0647 }
0648
0649 template< class ForwardRange >
0650 static_generic_list& range( ForwardRange& r )
0651 {
0652 return range( boost::begin(r), boost::end(r) );
0653 }
0654
0655 template< class ForwardRange >
0656 static_generic_list& range( const ForwardRange& r )
0657 {
0658 return range( boost::begin(r), boost::end(r) );
0659 }
0660
0661 #if !defined(BOOST_NO_CXX11_DECLTYPE_N3276) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
0662 template< class Container,
0663 class = decltype(Container(boost::declval<assign_reference<T>*>(), boost::declval<assign_reference<T>*>()))
0664 >
0665 operator Container() const
0666 {
0667 return this-> BOOST_NESTED_TEMPLATE convert_to_container<Container>();
0668 }
0669
0670 template< class Container,
0671 class = typename boost::enable_if< boost::is_same< boost::type_traits::yes_type, decltype(assign_is_array((Container*)0))> >::type,
0672 class = void
0673 >
0674 operator Container() const
0675 {
0676 return this-> BOOST_NESTED_TEMPLATE convert_to_container<Container>();
0677 }
0678 #elif !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
0679 template< class Container
0680 # if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
0681 , class = typename boost::disable_if< is_initializer_list<Container> >::type
0682 # endif
0683 , class = typename Container::iterator
0684 >
0685 operator Container() const
0686 {
0687 return this-> BOOST_NESTED_TEMPLATE convert_to_container<Container>();
0688 }
0689 #else
0690 template< class Container >
0691 operator Container() const
0692 {
0693 return this-> BOOST_NESTED_TEMPLATE convert_to_container<Container>();
0694 }
0695 #endif
0696
0697 private:
0698 void insert( T& r )
0699 {
0700 refs_[current_] = r;
0701 ++current_;
0702 }
0703
0704 static_generic_list();
0705
0706 mutable assign_reference<internal_value_type> refs_[N];
0707 int current_;
0708 };
0709
0710 }
0711
0712 namespace assign
0713 {
0714 template< class T >
0715 inline assign_detail::generic_list<BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type>
0716 list_of()
0717 {
0718 assign_detail::generic_list<BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type> gl;
0719 gl();
0720 return gl;
0721 }
0722
0723 #if !defined(BOOST_ASSIGN_USE_VARIADIC_TEMPLATES)
0724
0725 template< class T >
0726 inline assign_detail::generic_list<T>
0727 list_of( const T& t )
0728 {
0729 return assign_detail::generic_list<T>()( t );
0730 }
0731
0732 #else
0733
0734 template< class T >
0735 inline assign_detail::generic_list<BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type>
0736 list_of(T&& t)
0737 {
0738 assign_detail::generic_list<BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type> gl;
0739 gl(boost::forward<T>(t));
0740 return gl;
0741 }
0742
0743 #endif
0744
0745 template< int N, class T >
0746 inline assign_detail::static_generic_list< BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type,N>
0747 ref_list_of( T& t )
0748 {
0749 return assign_detail::static_generic_list<BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type,N>( t );
0750 }
0751
0752 template< int N, class T >
0753 inline assign_detail::static_generic_list<const BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type,N>
0754 cref_list_of( const T& t )
0755 {
0756 return assign_detail::static_generic_list<const BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type,N>( t );
0757 }
0758
0759 #if !defined(BOOST_ASSIGN_USE_VARIADIC_TEMPLATES)
0760
0761 #define BOOST_PP_LOCAL_LIMITS (1, BOOST_ASSIGN_MAX_PARAMETERS)
0762 #define BOOST_PP_LOCAL_MACRO(n) \
0763 template< class T, class U, BOOST_ASSIGN_PARAMS1(n) > \
0764 inline assign_detail::generic_list<T> \
0765 list_of(U const& u, BOOST_ASSIGN_PARAMS2(n) ) \
0766 { \
0767 return assign_detail::generic_list<T>()(u, BOOST_ASSIGN_PARAMS3(n)); \
0768 } \
0769
0770
0771 #include BOOST_PP_LOCAL_ITERATE()
0772
0773 #define BOOST_PP_LOCAL_LIMITS (1, BOOST_ASSIGN_MAX_PARAMETERS)
0774 #define BOOST_PP_LOCAL_MACRO(n) \
0775 template< class U, BOOST_ASSIGN_PARAMS1(n) > \
0776 inline assign_detail::generic_list< tuple<U, BOOST_ASSIGN_PARAMS4(n)> > \
0777 tuple_list_of(U u, BOOST_ASSIGN_PARAMS2_NO_REF(n) ) \
0778 { \
0779 return assign_detail::generic_list< tuple<U, BOOST_ASSIGN_PARAMS4(n)> >()( tuple<U,BOOST_ASSIGN_PARAMS4(n)>( u, BOOST_ASSIGN_PARAMS3(n) )); \
0780 } \
0781
0782
0783 #include BOOST_PP_LOCAL_ITERATE()
0784
0785 #else
0786 template< class T, class U, class... Us >
0787 inline assign_detail::generic_list<BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type>
0788 list_of(U&& u, Us&&... us)
0789 {
0790 assign_detail::generic_list<BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type> gl;
0791 gl(boost::forward<U>(u), boost::forward<Us>(us)...);
0792 return gl;
0793 }
0794
0795
0796 template< class U, class... Us >
0797 inline assign_detail::generic_list< tuple<U, Us...> >
0798 tuple_list_of(U u, Us... us)
0799 {
0800 assign_detail::generic_list< tuple<U, Us...> > gl;
0801 gl(tuple<U, Us...>(u, us...));
0802 return gl;
0803 }
0804 #endif
0805
0806 template< class Key, class T >
0807 inline assign_detail::generic_list< std::pair
0808 <
0809 BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<Key>::type,
0810 BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type
0811 > >
0812 map_list_of( const Key& k, const T& t )
0813 {
0814 typedef BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<Key>::type k_type;
0815 typedef BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<T>::type t_type;
0816 return assign_detail::generic_list< std::pair<k_type,t_type> >()( k, t );
0817 }
0818
0819 template< class F, class S >
0820 inline assign_detail::generic_list< std::pair
0821 <
0822 BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<F>::type,
0823 BOOST_DEDUCED_TYPENAME assign_detail::assign_decay<S>::type
0824 > >
0825 pair_list_of( const F& f, const S& s )
0826 {
0827 return map_list_of( f, s );
0828 }
0829
0830
0831 }
0832 }
0833
0834
0835 #if !defined(BOOST_ASSIGN_USE_VARIADIC_TEMPLATES)
0836
0837 #undef BOOST_ASSIGN_PARAMS1
0838 #undef BOOST_ASSIGN_PARAMS2
0839 #undef BOOST_ASSIGN_PARAMS3
0840 #undef BOOST_ASSIGN_PARAMS4
0841 #undef BOOST_ASSIGN_PARAMS2_NO_REF
0842 #undef BOOST_ASSIGN_MAX_PARAMETERS
0843
0844 #endif
0845
0846
0847 #endif