~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to system/include/libcxx/deque

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-09-20 22:44:35 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130920224435-apuwj4fsl3fqv1a6
Tags: 1.5.6~20130920~6010666-1
* New snapshot release
* Update the list of supported architectures to the same as libv8
  (Closes: #723129)
* emlibtool has been removed from upstream.
* Fix warning syntax-error-in-dep5-copyright
* Refresh of the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
    typedef random_access_iterator_tag  iterator_category;
279
279
    typedef _Reference                  reference;
280
280
 
281
 
    _LIBCPP_INLINE_VISIBILITY __deque_iterator() _NOEXCEPT {}
 
281
    _LIBCPP_INLINE_VISIBILITY __deque_iterator() _NOEXCEPT
 
282
#if _LIBCPP_STD_VER > 11
 
283
     : __m_iter_(nullptr), __ptr_(nullptr)
 
284
#endif
 
285
     {}
282
286
 
283
287
    template <class _Pp, class _Rp, class _MP>
284
288
    _LIBCPP_INLINE_VISIBILITY
915
919
                                                         __pointer_allocator;
916
920
    typedef allocator_traits<__pointer_allocator>        __map_traits;
917
921
    typedef typename __map_traits::pointer               __map_pointer;
918
 
    typedef typename __map_traits::const_pointer         __map_const_pointer;
 
922
    typedef typename __alloc_traits::template
 
923
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
 
924
                rebind_alloc<const_pointer>
 
925
#else
 
926
                rebind_alloc<const_pointer>::other
 
927
#endif
 
928
                                                         __const_pointer_allocator;
 
929
    typedef typename allocator_traits<__const_pointer_allocator>::const_pointer __map_const_pointer;
919
930
    typedef __split_buffer<pointer, __pointer_allocator> __map;
920
931
 
921
932
    typedef __deque_iterator<value_type, pointer, reference, __map_pointer,
1053
1064
typename __deque_base<_Tp, _Allocator>::const_iterator
1054
1065
__deque_base<_Tp, _Allocator>::begin() const _NOEXCEPT
1055
1066
{
1056
 
    __map_const_pointer __mp = __map_.begin() + __start_ / __block_size;
 
1067
    __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __start_ / __block_size);
1057
1068
    return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
1058
1069
}
1059
1070
 
1071
1082
__deque_base<_Tp, _Allocator>::end() const _NOEXCEPT
1072
1083
{
1073
1084
    size_type __p = size() + __start_;
1074
 
    __map_const_pointer __mp = __map_.begin() + __p / __block_size;
 
1085
    __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __p / __block_size);
1075
1086
    return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
1076
1087
}
1077
1088
 
1341
1352
    _LIBCPP_INLINE_VISIBILITY
1342
1353
    bool __invariants() const {return __base::__invariants();}
1343
1354
private:
 
1355
    typedef typename __base::__map_const_pointer __map_const_pointer;
 
1356
 
1344
1357
    _LIBCPP_INLINE_VISIBILITY
1345
1358
    static size_type __recommend_blocks(size_type __n)
1346
1359
    {
2505
2518
deque<_Tp, _Allocator>::pop_front()
2506
2519
{
2507
2520
    allocator_type& __a = __base::__alloc();
2508
 
    __alloc_traits::destroy(__a, *(__base::__map_.begin() +
2509
 
                                   __base::__start_ / __base::__block_size) +
2510
 
                                   __base::__start_ % __base::__block_size);
 
2521
    __alloc_traits::destroy(__a, __to_raw_pointer(*(__base::__map_.begin() +
 
2522
                                                    __base::__start_ / __base::__block_size) +
 
2523
                                                    __base::__start_ % __base::__block_size));
2511
2524
    --__base::size();
2512
2525
    if (++__base::__start_ >= 2 * __base::__block_size)
2513
2526
    {
2523
2536
{
2524
2537
    allocator_type& __a = __base::__alloc();
2525
2538
    size_type __p = __base::size() + __base::__start_ - 1;
2526
 
    __alloc_traits::destroy(__a, *(__base::__map_.begin() +
2527
 
                                   __p / __base::__block_size) +
2528
 
                                   __p % __base::__block_size);
 
2539
    __alloc_traits::destroy(__a, __to_raw_pointer(*(__base::__map_.begin() +
 
2540
                                                    __p / __base::__block_size) +
 
2541
                                                    __p % __base::__block_size));
2529
2542
    --__base::size();
2530
2543
    if (__back_spare() >= 2 * __base::__block_size)
2531
2544
    {
2556
2569
            __fe = __fb + __bs;
2557
2570
        }
2558
2571
        if (__fb <= __vt && __vt < __fe)
2559
 
            __vt = (const_iterator(__f.__m_iter_, __vt) -= __f - __r).__ptr_;
 
2572
            __vt = (const_iterator(static_cast<__map_const_pointer>(__f.__m_iter_), __vt) -= __f - __r).__ptr_;
2560
2573
        __r = _VSTD::move(__fb, __fe, __r);
2561
2574
        __n -= __bs;
2562
2575
        __f += __bs;
2587
2600
            __lb = __le - __bs;
2588
2601
        }
2589
2602
        if (__lb <= __vt && __vt < __le)
2590
 
            __vt = (const_iterator(__l.__m_iter_, __vt) += __r - __l - 1).__ptr_;
 
2603
            __vt = (const_iterator(static_cast<__map_const_pointer>(__l.__m_iter_), __vt) += __r - __l - 1).__ptr_;
2591
2604
        __r = _VSTD::move_backward(__lb, __le, __r);
2592
2605
        __n -= __bs;
2593
2606
        __l -= __bs - 1;
2618
2631
            __fe = __fb + __bs;
2619
2632
        }
2620
2633
        if (__fb <= __vt && __vt < __fe)
2621
 
            __vt = (const_iterator(__f.__m_iter_, __vt) += __r - __f).__ptr_;
 
2634
            __vt = (const_iterator(static_cast<__map_const_pointer>(__f.__m_iter_), __vt) += __r - __f).__ptr_;
2622
2635
        for (; __fb != __fe; ++__fb, ++__r, ++__base::size())
2623
2636
            __alloc_traits::construct(__a, _VSTD::addressof(*__r), _VSTD::move(*__fb));
2624
2637
        __n -= __bs;
2654
2667
            __lb = __le - __bs;
2655
2668
        }
2656
2669
        if (__lb <= __vt && __vt < __le)
2657
 
            __vt = (const_iterator(__l.__m_iter_, __vt) -= __l - __r + 1).__ptr_;
 
2670
            __vt = (const_iterator(static_cast<__map_const_pointer>(__l.__m_iter_), __vt) -= __l - __r + 1).__ptr_;
2658
2671
        while (__le != __lb)
2659
2672
        {
2660
2673
            __alloc_traits::construct(__a, _VSTD::addressof(*--__r), _VSTD::move(*--__le));