Commit 3f7abc83 authored by Davis King's avatar Davis King

Made the std_vector_c able to copy directly from std::vector objects.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402902
parent ad64c286
...@@ -48,7 +48,7 @@ namespace dlib ...@@ -48,7 +48,7 @@ namespace dlib
const Allocator& alloc= Allocator()) : impl(first,last,alloc) {} const Allocator& alloc= Allocator()) : impl(first,last,alloc) {}
std_vector_c(const std_vector_c<T,Allocator>& x) : impl(x.impl) {} std_vector_c(const std_vector_c<T,Allocator>& x) : impl(x.impl) {}
std_vector_c(const std::vector<T,Allocator>& x) : impl(x) {}
std_vector_c<T,Allocator>& operator=(const std_vector_c<T,Allocator>& x) std_vector_c<T,Allocator>& operator=(const std_vector_c<T,Allocator>& x)
{ {
...@@ -56,6 +56,12 @@ namespace dlib ...@@ -56,6 +56,12 @@ namespace dlib
return *this; return *this;
} }
std_vector_c<T,Allocator>& operator=(const std::vector<T,Allocator>& x)
{
impl = x;
return *this;
}
template <typename InputIterator> template <typename InputIterator>
void assign(InputIterator first, InputIterator last) { impl.assign(first,last); } void assign(InputIterator first, InputIterator last) { impl.assign(first,last); }
void assign(size_type n, const T& u) { impl.assign(n,u); } void assign(size_type n, const T& u) { impl.assign(n,u); }
......
...@@ -83,6 +83,13 @@ namespace dlib ...@@ -83,6 +83,13 @@ namespace dlib
- #*this == x - #*this == x
!*/ !*/
std_vector_c(
const std::vector<T,Allocator>& x
);
/*!
ensures
- #*this == x
!*/
std_vector_c<T,Allocator>& operator= ( std_vector_c<T,Allocator>& operator= (
const std_vector_c<T,Allocator>& x const std_vector_c<T,Allocator>& x
...@@ -93,6 +100,15 @@ namespace dlib ...@@ -93,6 +100,15 @@ namespace dlib
- returns #*this - returns #*this
!*/ !*/
std_vector_c<T,Allocator>& operator= (
const std::vector<T,Allocator>& x
);
/*!
ensures
- #*this == x
- returns #*this
!*/
template <typename InputIterator> template <typename InputIterator>
void assign( void assign(
InputIterator first, InputIterator first,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment