Well there could be performance related reasons if card were large and you were copying it around a lot, however that may be minimal in this case.
These days I like use objects with reference...
Type: Posts; User: SyntaxError
Well there could be performance related reasons if card were large and you were copying it around a lot, however that may be minimal in this case.
These days I like use objects with reference...
I'm not sure of your exact question. I learned C from K&R. These days I wouldn't learn it from a super old non-ansi K&R (my first C book) but if you like K&R I wouldn't hesitate to use the later...
Wrapper is kind of a generic term. There is not standard way of wrapping something. For instance you could write two classes with the same name that support the same functions for different operating...
When someone first told me the term wrapper class I thought they meant rapper class as it talks to another class. Actually the definition more or less works that way too. LOL
In any case, I...
Holy smokes! That looks to weird for my tastes. I wonder what the efficiency is like.
You sometimes use this in operator overloading. I was never quite sure where the object was created. I'm thinking almost for sure on the stack. However we used to call it magic space just to...
Well yeah.... However I generally try to avoid doing silly things like this. It seems to me there is some semi-legitimate situation where you need this-> but it escapes me at the moment.
As dwks said this-> is optional. It's pretty much the same as not having it. However it catches your eye and makes it a bit easier to see you are calling a member function or using member data of the...
It looks like you are indeed correct at least on Visual Studio. I just tested it. In addition what you said makes sense to me so I would imagine it works that way with a lot of compilers if not all...
When you think about it, this has to be the case with multiple in heritance. Addresses will always move around. This is why I avoid it if I can do something another way. I think (but don't quote me)...
Well I think I figured something out on my own. You can just walk the faces surrounding the vertex in a loop, sum up the normals and divide by the number of faces. The caveat is wherever the angle of...
I think the OP had two problems; the first being the order of operation error wich you fixed but even so I don't think ((B*) this)->f() will do what he wants since it will still call the virtual wich...
This seems a bit reversed from the original title of your thread. I mean if you have a standard C++ application (i.e. a console application) it should compile just fine in Visual C++. However...
I won't argue with that :) However, now that I have all the bugs out of the collision detector (which took me an eon) it actually works quite well and it gives me some big advantages over a normal...
I am currently working on a fractal based game engine. This engine generates a fractal world (yes it's actually roundish) from a set of functions and refines it and unrefines it in real time as you...
So sue me :)
Without going through your problem in detail (I appologize becuase I'm trying to get something done:)) would a virtual base class fix your problem? That way you should only have one copy of Base.
...
But everyone does not know. Most people simply use the thread libraries and it works for them. Also threading may not be standard but PThreads is pretty standard for Unix systems. That along with...
All I see is a function call. Is it a system function? Is it yours? On what machine(s) does this work? Your link talks about machine code which is architecture dependant. Read the section on...
I think I was pretty clear. It appears barrier() is a function call, is it not? Since we don't know what's in it, and given your comment, I'm assuming it is just there to guarantee some sort of...
In any case I wouldn't count on putting a routine call guaranteeing anything. What if the complier determines it does nothing and removes it. What if the compiler rearranges code anyway because it...
So what exactly does setting this local variable do?
Well I missed the extra int before. However this has nothing to do with the discussion at hand which is probably why I wasn't looking for errors like this. This kind of error can happen in non...
This is a well known "race case". I would guess most programmers who have had some basic training in thread programming will do this correctly. If you use a mutex of some sort it will work. However...
I have personally worked on very large applications. In code this big there tends to be other issues than just the treading model. In my experience threading issues have less to do with the size of...