Hi, let's say I have a class A with data members that are themselves classes (strings, vectors etc.). I know that if class A doesn't have an explicit destructor, these data members' destructors are called automatically, when an object of type A is destroyed.
However, I have an explicit destructor for class A (I need it for other data members).
Do I need to therefor also explicitly call the destructors of all class type data members now, in my explicit ~A destructor (i.e. name.~string(); ), or are those operations still handled automatically?
And, if yes, is the correct syntax name.~string(); , name.~String(); , or something else entirely?
Sorry for the over-complication (I should've asked the more general question to begin with), but what about constructors, the copy constructor, and operators (like the assignment operator)?
Do class type data members get their corresponding constructors/operators called as well, even if I have explicit constructors and an operator= function handling some of the data members?
so if it were builtin then it wouldnt be initialized right?
I don't know what "builtin" means, but members that weren't of class type would not be initialized implicitly, but that's true whether the default constructor is defaulted, supplied by the user, or not defaulted and not supplied by the user.
From context, I take it DTSCode means he thought that it was a built-in (data) type.
The C++ Standard index entry for "built-in type" says "see fundamental type (p 54)"...
Andy
Thinking about it, there are prob. too many analgous terms: fundamental (data) type, built-in type, primitive type, native type, simple type, intrinsic type, ... (I'm pretty sure these all refer to the same thing?)