mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-12 00:02:09 +00:00
Added templated versions of static_vector copy ctor and assignment.
GCC compile error fixed in test. [SVN r82028]
This commit is contained in:
@@ -75,7 +75,15 @@ public:
|
||||
static_vector(static_vector const& other)
|
||||
: m_size(other.m_size)
|
||||
{
|
||||
//BOOST_ASSERT_MSG(other.m_size <= Capacity, "size can't exceed the capacity");
|
||||
this->uninitialized_copy(other.begin(), other.end(), this->begin()); // may throw
|
||||
}
|
||||
|
||||
// strong
|
||||
template <size_t C>
|
||||
static_vector(static_vector<value_type, C> const& other)
|
||||
: m_size(other.m_size)
|
||||
{
|
||||
BOOST_ASSERT_MSG(other.m_size <= Capacity, "size can't exceed the capacity");
|
||||
//if ( Capacity <= other.m_size ) throw std::bad_alloc();
|
||||
|
||||
this->uninitialized_copy(other.begin(), other.end(), this->begin()); // may throw
|
||||
@@ -97,6 +105,15 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
// basic
|
||||
template <size_t C>
|
||||
static_vector & operator=(static_vector<value_type, C> const& other)
|
||||
{
|
||||
assign(other.begin(), other.end()); // may throw
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// nothrow
|
||||
~static_vector()
|
||||
{
|
||||
|
||||
@@ -426,7 +426,7 @@ void test_insert_nd(T const& val)
|
||||
for ( size_t i = 0 ; i <= h ; ++i )
|
||||
{
|
||||
static_vector<T, N> s1(s);
|
||||
std::list<T>::iterator it = l.begin();
|
||||
typename std::list<T>::iterator it = l.begin();
|
||||
std::advance(it, n);
|
||||
s1.insert(s1.begin() + i, l.begin(), it);
|
||||
BOOST_CHECK(s1.size() == h+n);
|
||||
|
||||
Reference in New Issue
Block a user