initialization-list
C++: Initialization of inherited field
I\'ve a question about initialization of inherited members in constructor of derived class. Example code:[详细]
2023-01-21 05:29 分类:问答Writing a Prototype Constructor in C++
I am taking a quadratic expression, where y=ax^2 + bx + c with a,b,c are constants and x is a variable. Here is my class:[详细]
2023-01-15 20:42 分类:问答C++: Initialize a member pointer to null?
I have a class that looks like: class Foo { public: Foo(); virtual ~Foo(); private: Odp* bar; }; I wish t开发者_Go百科o initialize bar to NULL. Is this the best way to do it?[详细]
2023-01-05 21:11 分类:问答Constructor initialization list: code from the C++ Primer, chapter 16
Toward the end of Chapter 16 of the \"C++ Primer\" I encountered the following code (I\'ve removed a bunch of lines):[详细]
2022-12-30 07:04 分类:问答C++ Constructor initialization list strangeness
I have always been a good boy when writing my classes, prefixing all member variables with m_: class Test {[详细]
2022-12-24 00:24 分类:问答How to catch the exception in initialization list? [duplicate]
This question already has answers here: Catching exceptions from a constructor's initializer list 开发者_StackOverflow(5 answers)[详细]
2022-12-22 17:21 分类:问答Initialize parent's protected members with initialization list (C++)
Is it possible to use the initialization list of a child class\' constructor to initialize data members declared as protected in the parent class?I can\'t get it to work.I can work around it, but it w[详细]
2022-12-20 19:10 分类:问答