D
dogpuke
I have a number of functions that return structs. Some sample calls:
mystruct = func_one(mystruct, var1, var2);
mystruct = func_two(mystruct, whatever, scale, thirdvar);
In every call, I'm passing the lvalue mystruct. I think it makes the
code repetitive and cluttered to have the lvalue listed as a parameter
on every function call.
I would rather have:
mystruct = func_one(var1, var2);
mystruct = func_two(whatever, scale, thirdvar);
Yet still be able to access the lvalue within the function. Is there a
way using the preprocessor or some other trick to accomplish this? If
it were the preprocessor, it could parse this line:
mystruct = func_one(var1, var2);
Find the value to the left of the = and insert it with a comma after
func_one(
Is there a way to do this?
mystruct = func_one(mystruct, var1, var2);
mystruct = func_two(mystruct, whatever, scale, thirdvar);
In every call, I'm passing the lvalue mystruct. I think it makes the
code repetitive and cluttered to have the lvalue listed as a parameter
on every function call.
I would rather have:
mystruct = func_one(var1, var2);
mystruct = func_two(whatever, scale, thirdvar);
Yet still be able to access the lvalue within the function. Is there a
way using the preprocessor or some other trick to accomplish this? If
it were the preprocessor, it could parse this line:
mystruct = func_one(var1, var2);
Find the value to the left of the = and insert it with a comma after
func_one(
Is there a way to do this?