Making default arguments explicit

Using BRONTO_INLINE() to make default arguments explicit

Given an existing function like

int GetTheData(int index = 0);

you can use BRONTO_INLINE() to force all callers to explicitly pass the default argument.

First remove the default argument and add an overload that delegates to the original.

int GetTheData(int index);

int GetTheData() { return GetTheData(/* index= */ 0); }

Now annotate the function without arguments for inlining.

int GetTheData(int index);

BRONTO_INLINE()
int GetTheData() { return GetTheData(/* index= */ 0); }

Sit back while Bronto makes the default argument explicit for all the callers that were using it.

After Bronto has finished, you can simply remove the version without arguments.

int GetTheData(int index);

See it in action on Compiler Explorer.