#include <bits/stl_iterator_base_funcs.h>
#include <bits/functexcept.h>
#include <bits/concept_check.h>
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
#include <initializer_list>
#endif
: _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
{ }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
_Vector_impl(_Tp_alloc_type&& __a)
: _Tp_alloc_type(std::move(__a)),
_M_start(0), _M_finish(0), _M_end_of_storage(0)
: _M_impl(__a)
{ _M_create_storage(__n); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
_Vector_base(_Tp_alloc_type&& __a)
: _M_impl(std::move(__a)) { }
vector(const allocator_type& __a)
: _Base(__a) { }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
/**
* @brief Creates a %vector with default constructed elements.
* @param __n The number of elements to initially create.
_M_get_Tp_allocator());
}
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
/**
* @brief %Vector move constructor.
* @param __x A %vector of identical element and allocator types.
* used, then this will do at most 2N calls to the copy
* constructor, and logN memory reallocations.
*/
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
template<typename _InputIterator,
typename = std::_RequireInputIter<_InputIterator>>
vector(_InputIterator __first, _InputIterator __last,
vector&
operator=(const vector& __x);
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
/**
* @brief %Vector move assignment operator.
* @param __x A %vector of identical element and allocator types.
* that the resulting %vector's size is the same as the number
* of elements assigned. Old data may be lost.
*/
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
template<typename _InputIterator,
typename = std::_RequireInputIter<_InputIterator>>
void
}
#endif
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
/**
* @brief Assigns an initializer list to a %vector.
* @param __l An initializer_list.
rend() const _GLIBCXX_NOEXCEPT
{ return const_reverse_iterator(begin()); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
/**
* Returns a read-only (constant) iterator that points to the
* first element in the %vector. Iteration is done in ordinary
max_size() const _GLIBCXX_NOEXCEPT
{ return _Alloc_traits::max_size(_M_get_Tp_allocator()); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
/**
* @brief Resizes the %vector to the specified number of elements.
* @param __new_size Number of elements the %vector should contain.
}
#endif
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
/** A non-binding request to reduce capacity() to size(). */
void
shrink_to_fit()
* Returns a pointer such that [data(), data() + size()) is a valid
* range. For a non-empty %vector, data() == &front().
*/
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
_Tp*
#else
pointer
data() _GLIBCXX_NOEXCEPT
{ return std::__addressof(front()); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
const _Tp*
#else
const_pointer
++this->_M_impl._M_finish;
}
else
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
_M_emplace_back_aux(__x);
#else
_M_insert_aux(end(), __x);
#endif
}
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
void
push_back(value_type&& __x)
{ emplace_back(std::move(__x)); }
_Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
}
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
/**
* @brief Inserts an object in %vector before specified iterator.
* @param __position An iterator into the %vector.
iterator
insert(iterator __position, const value_type& __x);
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
/**
* @brief Inserts given rvalue into %vector before specified iterator.
* @param __position An iterator into the %vector.
* %vector and if it is frequently used the user should
* consider using std::list.
*/
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
template<typename _InputIterator,
typename = std::_RequireInputIter<_InputIterator>>
void
*/
void
swap(vector& __x)
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
noexcept(_Alloc_traits::_S_nothrow_swap())
#endif
{
this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
}
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
// Called by the vector(n) constructor.
void
_M_default_initialize(size_type __n)
void
_M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
// Called by resize(n).
void
_M_default_append(size_type __n);
#endif
// Called by insert(p,x)
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus < 201103L
void
_M_insert_aux(iterator __position, const value_type& __x);
#else
this->_M_impl._M_finish = __pos;
}
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
private:
// Constant-time move assignment when source object's memory can be
// moved, either because the source's allocator will move too