Search:
Type: Posts; User: TubularX
Search:
Search took 0.04 seconds.
-
August 27th, 2018, 01:52 AM
That's not fair, I never said that or tried to imply that. Then you misunderstood. I say value semantics is a good alternative that should often be preferred.
-
August 26th, 2018, 04:24 PM
I do think it's relevant to mention that when refactoring object oriented code in C++, it may be a good idea to move away from inheritance based design.
Bjarne Stroustrup gave an interesting talk...
-
August 24th, 2018, 01:23 PM
Right, I guess it depends on what's meant by strict. Indeed, more and more functional programming ideas have been included in mainstream OOP languages.
No, that's not what I'm arguing.
In...
-
August 23rd, 2018, 06:30 AM
You can send the command as second parameter.
See example:
https://docs.microsoft.com/en-us/windows/desktop/ProcThread/creating-processes
If still not working, call GetLastError() and let us...
-
August 22nd, 2018, 04:55 AM
Thank you 2kaud for sharing your thoughts. Considering the title of the book, I think it's fair to expect that the reader knows C++.
OK, so I've just got hold of a copy and read a few random...
-
August 21st, 2018, 07:26 AM
I haven't read it. Do you recommend buying it? I wasn't convinced by the reviews.
Here is a video presentation that I find helpful:
...
-
August 21st, 2018, 04:44 AM
You should use a member function if it maintains the invariant of the class (the meaning of invariant is explained in the interview referred to by laserlight). Otherwise prefer non-member functions....
-
August 20th, 2018, 11:48 AM
Regarding refactoring large systems, I would recommend:
- Working Effectively with Legacy Code
- The Mikado Method
Regarding design, in C++ you don't have to use a strict object-oriented design,...
-
August 14th, 2018, 03:34 PM
I'm sorry, I did not know. Did I miss something? There is no mention of C++98. I was just trying to give some helpful advice.
-
August 14th, 2018, 12:28 PM
The C++ Core Guidelines recommends (and enforces) the following order:
constructors, assignments, destructor
functions
data
That's good for readability and consistency, but doesn't make any...
-
July 31st, 2018, 09:23 AM
That sounds like "one way communication" as I mentioned in my previous post. The side effect of printing is probably only important to the user and doesn't affect the rest of the code (assuming that...
-
July 28th, 2018, 11:16 AM
Well, the advice from your link says:
"If a dependency is ambient, meaning that it is used by many classes and/or multiple layers, use Singleton."
I just don't think it's that simple. That may...
-
July 28th, 2018, 09:09 AM
There are advantages, for example regarding unit testing.
Coupling with a specific class can be avoided. For example, you can use a template. Or use a function as parameter (a lambda function...
-
July 25th, 2018, 06:03 PM
Don't do that unless you have very good reasons. It may seem convenient to be able to access your data from any function, but it has many drawbacks. It will make your code harder to understand and...
-
July 25th, 2018, 12:27 PM
You're using a C array of chars. C arrays don't have any members.
Did you mean to use std::string? It has a compare member function.
Anyway, you don't need to call compare for such a simple...
-
July 13th, 2018, 04:51 AM
You're welcome.
Like 2kaud said, it would be a good idea to upgrade your compiler.
As a side note, you should be able to make your code more efficient by replacing:
Mat2Copy =...
-
July 11th, 2018, 09:44 AM
OK, I see a problem here. You're creating a copy of each blob, and then you modify the copy. The blob inside the vector is not updated.
CBlob iteratorBlob = *it;...
-
July 10th, 2018, 07:46 AM
My guess would be that you need to clear the m_blobs vector after every frame, otherwise all blobs will be drawn for every frame (see the call to drawBlobInfoOnImage). This is based on the assumption...
-
Windows is a message-oriented operating system, so you don't need a separate thread for doing that. Whenever a button is pressed, a message will be sent that you can handle. Preferably with message...
-
Hi, can you explain where the view is updated in your MFC code? I don't see any call to the view, or any call like imshow that was used in your first example.
And why do you need this line?
...
-
Adding "using namespace" to a scope means that names/symbols in the specified namespace will be available for lookup in that scope.
If you do that at global scope in a header file, it means that...
-
The base class should be abstract, not the derived class. It should look something like this:
class base
{
public:
virtual ~base() = default;
virtual void Move() = 0;
-
Right, the copied object will have a pointer that points to the same memory.
If you really want to make a copy, you would either need to make a deep copy (i.e. make sure the memory pointed to is...
-
This is OK. Declaring the copy constructor private without defining it, is an old trick to prevent copies. (in modern C++, "= delete" can be used instead).
The Anfiteatro class has a pointer...
-
Is there any reason why you need it to be a child window?
It would be much easier to just draw the text on top of the button image with Gdiplus::Graphics:: DrawString.
That would have the same...
|
Click Here to Expand Forum to Full Width
|