delete-operator
Creating objects in C++ not using "new"
I want to make a program that lets say represents a matrix now the matrix will be represented by a vector that each object in the vector will[详细]
2023-01-16 17:37 分类:问答new/delete "override" vs. "overload"
I always thought... overriding means reimplementing a function (sa开发者_StackOverflow中文版me signature) in a base class whereas[详细]
2023-01-16 12:57 分类:问答Is deleting an array stored as static local variable needed, and how?
I have a few arrays and a resource that needs deletion, the value of these variables are retained throughout the lifetime of the program and they are only used in a single f开发者_运维技巧unction so i[详细]
2023-01-15 22:51 分类:问答C++ Inheritance: Destructor does not get called
I got my code like the following: class TimeManager { public: virtual ~TimeManager(); }; class UserManager : virtual public TimeManager[详细]
2023-01-13 12:15 分类:问答Can I call `delete` on a vector of pointers in C++ via for_each <algorithm>?
Suppose I have a std::vector<Obj *> objs (for performance reasons I have pointers not actual Objs).[详细]
2023-01-11 19:14 分类:问答delete function in C++
I saw an example of using the function: delete in cpp and I didn\'t completely understand it. the code is:[详细]
2023-01-10 20:02 分类:问答Where in the C++ Standard does it say ::delete can change lvalues?
I ran into my first compiler that changes the lvalue passed to ::delete, but doesn\'t zero out the lvalue. That is the following is true:[详细]
2023-01-09 18:27 分类:问答Are there any other keywords that can be accessed using the global namespace scope resolution operator?
The global new and delete can be used like normal, but you can also prefix the :: operator to them and it w开发者_Python百科ill work the same.[详细]
2023-01-09 10:12 分类:问答std::list remove calling delete on pointer?
I ran valgrind on my program because of a segfault I can\'t figure out. It detected a problem here...[详细]
2023-01-09 06:18 分类:问答What is the right way to free a std::vector of pointers in C++?
I searched StackOverflow but couldn\'t find the answer to this question. Suppose I have a std::vector<Day *> vector_day - that is - a v开发者_开发技巧ector of pointers to Day object. Now I push[详细]
2023-01-08 21:12 分类:问答