You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vectors can be created without assigning their elements, IE the attribute Vector.vector can be nullptr if one uses the default constructor.
This can potentially lead to seg faults, since one could then run
Vector<double> v;
v[0];
What is particularly odd is that once created, Vector has no method to assign (or reassign) a valid block of memory to vector.
As such, it doesn't seem to make sense as to why we should allow creation of this object in this way. The default constructor for Vector should be removed, and the classes that have Vector attributes should be checked over for similar issues.
The text was updated successfully, but these errors were encountered:
Vector
class is declared inarrays.h
Vector
s can be created without assigning their elements, IE the attributeVector.vector
can benullptr
if one uses the default constructor.This can potentially lead to seg faults, since one could then run
What is particularly odd is that once created,
Vector
has no method to assign (or reassign) a valid block of memory tovector
.As such, it doesn't seem to make sense as to why we should allow creation of this object in this way. The default constructor for
Vector
should be removed, and the classes that haveVector
attributes should be checked over for similar issues.The text was updated successfully, but these errors were encountered: