Click here to Skip to main content
15,867,704 members

Comments by WaZoX (Top 39 by date)

WaZoX 22-May-17 7:33am View    
That did the trick.

Yes it's a template type so you are probably right. It makes sense to allow some additional memory consumption to avoid side effects!

Thanks a lot for your help!
WaZoX 17-May-17 7:59am View    
I will have to investigate that further. Thanks!
WaZoX 17-May-17 7:57am View    
Thanks for your suggestion.

I changed the union to this:

union TargetData
{
TargetData() { location = FVector(); }
TargetData(const FVector &inLocation) { location = inLocation; }
TargetData(AActor *inActor) { targetActor = inActor; }

FVector location;
TWeakObjectPtr<aactor> targetActor;
} targetData;

Now I get the complains at the union instead. E.g. for the empty constructor I get the following errors:
error C4582: 'Target::TargetData::location': constructor is not implicitly called
error C4582: 'Target::TargetData::targetActor': constructor is not implicitly called
...
WaZoX 17-May-17 7:26am View    
Thanks for your reply! A name for the union isn't needed in the link you posted, see the "Unrestricted Unions" example. I looked at it before but can't understand why I can't get my code to work. For me that example looks pretty much the same as mine?
WaZoX 1-Jul-13 20:03pm View    
(8 * size + 7) / 8 = 1 * size + 7/8
Assuming it's integer arithmetic, 7/8 = 0 therefore,
1 * size + 7/8 = size + 0 = size

(8 * size + 7) / 8 = size ?