Default arguments skipping?

I do not understand how default arguments in the middle of the call were skipped. As far as I know C++ does not allow this. How did the the following function

`if (UGameplayStatics::SuggestProjectileVelocity(
		this,
		outLaunchVelocity,
		startLocation,
		aimLocation,
		launchSpeed,
		false,
		0.f,
		0, 
		ESuggestProjVelocityTraceOption::DoNotTrace))`	 

become

`if (UGameplayStatics::SuggestProjectileVelocity(
		this,
		outLaunchVelocity,
		startLocation,
		aimLocation,
		launchSpeed,
		ESuggestProjVelocityTraceOption::DoNotTrace))`

?

2 Likes

Actually it is corrected in the upcoming lectures.
And yes, it is not allowed by C++.

1 Like

Yes, I too thought that and as you say, it’s wrong. Ben corrects this later.

Ok great, I thought I lost my sanity :slight_smile:

What confused me is that the code compiled without problems, until you realize that the compiler silently converts an enum into a bool.

Thanks for the answers.

2 Likes

Privacy & Terms