EDN Admin
Well-known member
I have a class called "Neuron" for which I do not have a copy constructor, as I dont want to copy it. However, when I try to compile my code I get this long pile of errors from VS2012:1>crogram files (x86)microsoft visual studio 11.0vcincludexutility(2466): error C2582: operator = function is unavailable in EDIN::Neuron
1> crogram files (x86)microsoft visual studio 11.0vcincludexutility(2487) : see reference to function template instantiation _OutIt std::_Move<_InIt,_OutIt>(_InIt,_InIt,_OutIt,std::_Nonscalar_ptr_iterator_tag) being compiled
1> with
1> [
1> _OutIt=EDIN::Neuron *,
1> _InIt=EDIN::Neuron *
1> ]
1> crogram files (x86)microsoft visual studio 11.0vcincludevector(1397) : see reference to function template instantiation _OutIt std::_Move<EDIN::Neuron*,EDIN::Neuron*>(_InIt,_InIt,_OutIt) being compiled
1> with
1> [
1> _OutIt=EDIN::Neuron *,
1> _InIt=EDIN::Neuron *
1> ]
1> crogram files (x86)microsoft visual studio 11.0vcincludevector(1381) : while compiling class template member function std::_Vector_iterator<_Myvec> std::vector<_Ty>::erase(std::_Vector_const_iterator<_Myvec>,std::_Vector_const_iterator<_Myvec>)
1> with
1> [
1> _Myvec=std::_Vector_val<std::_Simple_types<EDIN::Neuron>>,
1> _Ty=EDIN::Neuron
1> ]
1> crogram files (x86)microsoft visual studio 11.0vcincludevector(1061) : see reference to function template instantiation std::_Vector_iterator<_Myvec> std::vector<_Ty>::erase(std::_Vector_const_iterator<_Myvec>,std::_Vector_const_iterator<_Myvec>) being compiled
1> with
1> [
1> _Myvec=std::_Vector_val<std::_Simple_types<EDIN::Neuron>>,
1> _Ty=EDIN::Neuron
1> ]
1> c:usersusrgoogle drivecodeedinclass_brain.h(14) : see reference to class template instantiation std::vector<_Ty> being compiled
1> with
1> [
1> _Ty=EDIN::Neuron
1> ]
Strangely, the only part of that error where one of my own files is mentioned is "class_brain.h" line 14, which is just a declaration for the class:class Brain
{
public:
Brain(std::vector<Codon> const&); // construct the brain from a brain codon sequence (ostensibly from a brain gene)
// ...some methods go here...
private:
std::vector<Neuron> neuron_sequence; // Line 14
};
If there is some problem with what I am doing with neuron_sequence, why doesnt it show me where the issue is?
View the full article
1> crogram files (x86)microsoft visual studio 11.0vcincludexutility(2487) : see reference to function template instantiation _OutIt std::_Move<_InIt,_OutIt>(_InIt,_InIt,_OutIt,std::_Nonscalar_ptr_iterator_tag) being compiled
1> with
1> [
1> _OutIt=EDIN::Neuron *,
1> _InIt=EDIN::Neuron *
1> ]
1> crogram files (x86)microsoft visual studio 11.0vcincludevector(1397) : see reference to function template instantiation _OutIt std::_Move<EDIN::Neuron*,EDIN::Neuron*>(_InIt,_InIt,_OutIt) being compiled
1> with
1> [
1> _OutIt=EDIN::Neuron *,
1> _InIt=EDIN::Neuron *
1> ]
1> crogram files (x86)microsoft visual studio 11.0vcincludevector(1381) : while compiling class template member function std::_Vector_iterator<_Myvec> std::vector<_Ty>::erase(std::_Vector_const_iterator<_Myvec>,std::_Vector_const_iterator<_Myvec>)
1> with
1> [
1> _Myvec=std::_Vector_val<std::_Simple_types<EDIN::Neuron>>,
1> _Ty=EDIN::Neuron
1> ]
1> crogram files (x86)microsoft visual studio 11.0vcincludevector(1061) : see reference to function template instantiation std::_Vector_iterator<_Myvec> std::vector<_Ty>::erase(std::_Vector_const_iterator<_Myvec>,std::_Vector_const_iterator<_Myvec>) being compiled
1> with
1> [
1> _Myvec=std::_Vector_val<std::_Simple_types<EDIN::Neuron>>,
1> _Ty=EDIN::Neuron
1> ]
1> c:usersusrgoogle drivecodeedinclass_brain.h(14) : see reference to class template instantiation std::vector<_Ty> being compiled
1> with
1> [
1> _Ty=EDIN::Neuron
1> ]
Strangely, the only part of that error where one of my own files is mentioned is "class_brain.h" line 14, which is just a declaration for the class:class Brain
{
public:
Brain(std::vector<Codon> const&); // construct the brain from a brain codon sequence (ostensibly from a brain gene)
// ...some methods go here...
private:
std::vector<Neuron> neuron_sequence; // Line 14
};
If there is some problem with what I am doing with neuron_sequence, why doesnt it show me where the issue is?
View the full article