the program is about Blob<T>, where shared_ptr<std::vector<T> > as its data members. be noted that the real problem here is about shared_ptr of my own version (simple one) but atleast (should) worked with the Blob<T>, which is the std::shared_ptr did, but not with mine. [Error Msg](http://postimg.org/image/krwflmyhx/) the error msg above is produced through object that's being constructed by initializer list. if the object being constructed through default constructor then being append by push_back() function. the program compile but crashed. just after the shared_ptr::operator*() executed.yet I still unable to figure out the problems. T& operator*() const { return *p; } T* …

Member Avatar
Member Avatar
+0 forum 7

Hello everybody! I'm trying to display the result of addition of vectors. But Builder shows the error after compilation (line 29). What should I change for in my code in order to find the problem? Thanks in advance. #include <iostream.h> #include <iomanip.h> #include <conio.h> class CVector2D { public: CVector2D(double x0 = 0, double y0 = 0) :x(x0), y(y0) { } double x, y; CVector2D const operator +(CVector2D const& vector2)const { return CVector2D(x + vector2.x, y + vector2.y); } }; using namespace std; int main() { CVector2D a(3.0, 5.8); CVector2D b(7.3, 8.8); CVector2D c = a + b + CVector2D(3, 9); …

Member Avatar
Member Avatar
+0 forum 2

Do you need to implement a class in order for an object to access the class's functions/methods? When should you implement a class? When shouldn't you?

Member Avatar
Member Avatar
+0 forum 2

The End.