Wrong behavior of map_array copy constructor.
Open
- Dominant language
- C++
- Stars
- 122
- Forks
- 151
- PR merge metrics
- No merged PRs in 30d
Description
map_array copy constructor is not functions as expected, leading to crash.
Code to reproduce:
```C++
boost::numeric::ublas::map_array getMapArray()
{
boost::numeric::ublas::map_array ma;
ma.insert(std::make_pair(1, 1.0f));
return ma;
}
int main()
{
boost::numeric::ublas::map_array ma = getMapArray();
return 0;
}
```
Fix:
in line 248 of storage_sparse.hpp,
```C++
//std::uninitialized_copy (data_, data_ + capacity_, c.data_); // original implementation
std::uninitialized_copy (c.data_, c.data_ + c.size_, data_);
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.