I have built a class in an external library that I was hoping to use in other areas. However, when I try to use the class within an std::vector I get compile errors
from ../../src/geom/geom.cpp:21:
/usr/include/c++/4.8.2/ext/new_allocator.h: In instantiation of `void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = GenUtils::MeshNormalData; _Args = {const GenUtils::MeshNormalData&}; _Tp = GenUtils::MeshNormalData]`:
/usr/include/c++/4.8.2/bits/alloc_traits.h:254:4: required from `static typename std::enable_if<std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::value, void>::type std::allocator_traits<_Alloc>::_S_construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = GenUtils::MeshNormalData; _Args = {const GenUtils::MeshNormalData&}; _Alloc = std::allocator<GenUtils::MeshNormalData>; typename std::enable_if<std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::value, void>::type = void]`
/usr/include/c++/4.8.2/bits/alloc_traits.h:393:57: required from `static decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) std::allocator_traits<_Alloc>::construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = GenUtils::MeshNormalData; _Args = {const GenUtils::MeshNormalData&}; _Alloc = std::allocator<GenUtils::MeshNormalData>; decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) = <type error>]`
/usr/include/c++/4.8.2/bits/stl_vector.h:906:34: required from `void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = GenUtils::MeshNormalData; _Alloc = std::allocator<GenUtils::MeshNormalData>; std::vector<_Tp, _Alloc>::value_type = GenUtils::MeshNormalData]’
../../src/geom/geom.cpp:315:47: required from here
/usr/include/c++/4.8.2/ext/new_allocator.h:120:4: error: use of deleted function `GenUtils::MeshNormalData::MeshNormalData(const GenUtils::MeshNormalData&)`
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
^
In file included from ../../src/geom/geom.h:60:0,
from ../../src/geom/geom.cpp:21:
../../src/libs/utils/generalUtils.h:94:7: note: `GenUtils::MeshNormalData::MeshNormalData(const GenUtils::MeshNormalData&)` is implicitly deleted because the default definition would be ill-formed:
class MeshNormalData
in libs/generalUtils.h
namespace GenUtils
{
class MeshNormalData
{
public:
MeshNormalData(){}
};
}
in geom.h
#include generalUtils.h
class TestGeo : public Base
{
public:
TestGeo(){};
private:
std::vector< GenUtils::MeshNormalData > meshnormals;
void compute_geo();
};
in geom.cpp
void TestGeo::compute_geo()
{
meshnormals.clear()
GenUtils::MeshNormalData normals()
//- doing other computation on normals
meshnormals.push_back( normals );
}
What am I missing? Any advice? Need help deciphering my error.