C2663: 2 overloads have no legal conversions for 'this' pointer

Hi,

I want to get all ActionMappings and put them in a struct called FActionInput:

USTRUCT(BlueprintType)
struct FKeyCommand
{
	//...

	FKeyCommand(const FInputActionKeyMapping& Action)
		:
		Key(Action.Key),
		bShift(Action.bShift),
		bCtrl(Action.bCtrl),
		bAlt(Action.bAlt)
	{

	}
};

USTRUCT(BlueprintType)
struct FActionInput
{
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Default")
	TArray<FKeyCommand> Keys;

	//...

	FActionInput(const FInputActionKeyMapping& pAction)
	{
		//...
	}
}

Now, when I want to add some keys:

//TArray<FActionInput>& Inputs

for (const FActionInput& input : Inputs)
{
	//...
	input.Keys.Add(FKeyCommand(...));
}

I always get that C2663 error. It has something to do with const but I don’t know where I need to remove or add a const without getting less errors. Can you help me?

The problem was at adding some keys on line 3: the const in the for loop needed to be removed:

for (FActionInput& input : Inputs)