![]() |
question about C++ syntax
I am coming from a Java background, and only have briefly played with C++. I am trying to understand what is going on in this mozilla function, (some mozilla seamonkey code) but I do not understand the syntax and cannot find anything like it in a book.
Code:
nsHttpConnection::nsHttpConnection()Thank you in advance for your insight. |
Yep, thats how I understand it.
|
Yep. They're default values.
"Seamonkey code." I like that. :D |
Quote:
If you do not do this, then members will be initialized with the default constructor (no arguments); which may not be desirable. For class types, if you do not provide an initializer and assign something to it later, that is bad because it has to construct it using the default constructor, and then assign something else using the assignment operator. Also, some types (references and const types) cannot be assigned to or copied to, and therefore must be initialized this way. In Java, you did not have to deal with this because all values are either primitive types or reference types, and so don't need to be initialized specially. |
| All times are GMT -5. The time now is 12:07 PM. |