~ubuntu-branches/ubuntu/trusty/emscripten/trusty-proposed

« back to all changes in this revision

Viewing changes to system/include/libcxx/forward_list

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20140119141240-jg1l42cc158j59tn
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
        noexcept(is_nothrow_default_constructible<allocator_type>::value);
39
39
    explicit forward_list(const allocator_type& a);
40
40
    explicit forward_list(size_type n);
 
41
    explicit forward_list(size_type n, const allocator_type& a); // C++14
41
42
    forward_list(size_type n, const value_type& v);
42
43
    forward_list(size_type n, const value_type& v, const allocator_type& a);
43
44
    template <class InputIterator>
212
213
    value_type __value_;
213
214
};
214
215
 
215
 
template<class _Tp, class _Alloc> class _LIBCPP_TYPE_VIS forward_list;
216
 
template<class _NodeConstPtr> class _LIBCPP_TYPE_VIS __forward_list_const_iterator;
 
216
template<class _Tp, class _Alloc> class _LIBCPP_TYPE_VIS_ONLY forward_list;
 
217
template<class _NodeConstPtr> class _LIBCPP_TYPE_VIS_ONLY __forward_list_const_iterator;
217
218
 
218
219
template <class _NodePtr>
219
 
class _LIBCPP_TYPE_VIS __forward_list_iterator
 
220
class _LIBCPP_TYPE_VIS_ONLY __forward_list_iterator
220
221
{
221
222
    typedef _NodePtr __node_pointer;
222
223
 
225
226
    _LIBCPP_INLINE_VISIBILITY
226
227
    explicit __forward_list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
227
228
 
228
 
    template<class, class> friend class _LIBCPP_TYPE_VIS forward_list;
229
 
    template<class> friend class _LIBCPP_TYPE_VIS __forward_list_const_iterator;
 
229
    template<class, class> friend class _LIBCPP_TYPE_VIS_ONLY forward_list;
 
230
    template<class> friend class _LIBCPP_TYPE_VIS_ONLY __forward_list_const_iterator;
230
231
 
231
232
public:
232
233
    typedef forward_iterator_tag                              iterator_category;
276
277
};
277
278
 
278
279
template <class _NodeConstPtr>
279
 
class _LIBCPP_TYPE_VIS __forward_list_const_iterator
 
280
class _LIBCPP_TYPE_VIS_ONLY __forward_list_const_iterator
280
281
{
281
282
    typedef _NodeConstPtr __node_const_pointer;
282
283
 
542
543
}
543
544
 
544
545
template <class _Tp, class _Alloc = allocator<_Tp> >
545
 
class _LIBCPP_TYPE_VIS forward_list
 
546
class _LIBCPP_TYPE_VIS_ONLY forward_list
546
547
    : private __forward_list_base<_Tp, _Alloc>
547
548
{
548
549
    typedef __forward_list_base<_Tp, _Alloc> base;
571
572
        {} // = default;
572
573
    explicit forward_list(const allocator_type& __a);
573
574
    explicit forward_list(size_type __n);
 
575
#if _LIBCPP_STD_VER > 11
 
576
    explicit forward_list(size_type __n, const allocator_type& __a);
 
577
#endif
574
578
    forward_list(size_type __n, const value_type& __v);
575
579
    forward_list(size_type __n, const value_type& __v, const allocator_type& __a);
576
580
    template <class _InputIterator>
794
798
    }
795
799
}
796
800
 
 
801
#if _LIBCPP_STD_VER > 11
 
802
template <class _Tp, class _Alloc>
 
803
forward_list<_Tp, _Alloc>::forward_list(size_type __n, const allocator_type& __a)
 
804
    : base ( __a )
 
805
{
 
806
    if (__n > 0)
 
807
    {
 
808
        __node_allocator& __a = base::__alloc();
 
809
        typedef __allocator_destructor<__node_allocator> _Dp;
 
810
        unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1));
 
811
        for (__node_pointer __p = base::__before_begin(); __n > 0; --__n,
 
812
                                                             __p = __p->__next_)
 
813
        {
 
814
            __h.reset(__node_traits::allocate(__a, 1));
 
815
            __node_traits::construct(__a, _VSTD::addressof(__h->__value_));
 
816
            __h->__next_ = nullptr;
 
817
            __p->__next_ = __h.release();
 
818
        }
 
819
    }
 
820
}
 
821
#endif
 
822
 
797
823
template <class _Tp, class _Alloc>
798
824
forward_list<_Tp, _Alloc>::forward_list(size_type __n, const value_type& __v)
799
825
{