You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The default constructor has a specific purpose for initialising an array of objects of its class. A constructor with all its parameters set to default isnot a default computer. Tut.
I highlighted the typo in red.
By the way, why is such a constructor not a constructor by default? Another crutch?
A default constructor has a specific purpose for initialising an array of objects of its class. A constructor with all its parameters set to default isnot a default computer. Here
"Invalid pointer access" =="Attempting to access an invalid pointer"?
Often a direct sign of a bad hand or lack of understanding of the basic principles of working with pointers.
Less often a sign of poorly documented class usage.
By the way, why isn't this constructor a default constructor? Another crutch?
Quite the opposite. The crutch is having default parameters, as this is a source of hard-to-find bugs. This is where we are being strict.
If you write a constructor with parameters, you are able to write a parameterless constructor as well. And if you have a default constructor, you can't write a parametric constructor with all the default parameters.
It is a crutch to have default parameters, as this is a source of hard to catch bugs.
Yes somehow I can't think of any such situations.
And if there is a default constructor, you can't write a parametric constructor with all the default parameters.
I read aboutthe context resolution operation ( ::: ). I decided to try to use it in two unrelated classes:
The compiler gives an error on the line C_A::funcA(j). If I comment it out, it seems to work. What is my mistake?
I read aboutthe context resolution operation ( ::: ). I decided to try to use it in two unrelated classes:
The compiler generates an error on the line C_A::funcA(j). If I comment it out, it seems to work. What is my mistake?
In your case, the context of class C_A is not available from class C_B.
It's only correct if:
But then it can:
In general, such calls are used for overloaded methods:
Approximately like this.
In your case, the context of class C_A is not available from class C_B.
I'm trying to pass member values from one class to another "by reference" and using a descriptor. Both variants seem to work. Here is the simplest scheme:
Which of these two methods works faster? Which one is more preferable?
I'm trying to pass member values from one class to another "by reference" and using a descriptor. Both options seem to work. Here is the simplest scheme:
Which of these two methods works faster? Which is more preferable?
Are the questions really heavy/incorrect?
For a long time I used the first way ("following the link"), but I really like the idea of descriptors. Just don't know if it's worth rewriting all classes because of it.