NRVec from std::list
This commit is contained in:
parent
10985a146b
commit
0e8c20770f
7
vec.cc
7
vec.cc
@ -898,6 +898,13 @@ return -1;
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
NRVec<T>::NRVec(const std::list<T> l)
|
||||
{
|
||||
resize(l.size());
|
||||
int ii=0;
|
||||
for(typename std::list<T>::const_iterator i=l.begin(); i!=l.end(); ++i) (*this)[ii++] = *i;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************//**
|
||||
|
4
vec.h
4
vec.h
@ -21,6 +21,7 @@
|
||||
#define _LA_VEC_H_
|
||||
|
||||
#include "la_traits.h"
|
||||
#include <list>
|
||||
|
||||
namespace LA {
|
||||
|
||||
@ -140,6 +141,9 @@ public:
|
||||
//! inlined copy constructor
|
||||
inline NRVec(const NRVec &rhs);
|
||||
|
||||
//! constructor from std::list
|
||||
NRVec(const std::list<T> l);
|
||||
|
||||
//! complexifying constructor
|
||||
NRVec(const typename LA_traits_complex<T>::NRVec_Noncomplex_type &rhs, bool imagpart=false);//construct complex from real
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user