# C++ Unreal Engine 4 ERROR C4458. Please help.

**URL:** <https://forums.unrealengine.com/t/c-unreal-engine-4-error-c4458-please-help/263862>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [December 2, 2021, 11:56pm UTC](https://forums.unrealengine.com/t/c-unreal-engine-4-error-c4458-please-help/263862 "2021-12-02T23:56:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GRIMTEC](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/grimtec/32/251054_2.png) [@GRIMTEC](https://forums.unrealengine.com/u/GRIMTEC)\
**Post date:** [December 3, 2021, 5:14pm UTC](https://forums.unrealengine.com/t/c-unreal-engine-4-error-c4458-please-help/263862/2 "2021-12-03T17:14:08Z")

</div>

Hi!

you have a class member named “item”:

```auto
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
		TSubclassOf<class AItem> item;

```

and you also have a function parameter named “item”:

```auto
	bool operator==(const FInventoryItem& item) const <----- ERROR HERE
	{
		if (itemId == item.itemId)
			return true;
		else return false;
	}

```

You code is actually correct and the error you are getting is technically not an error but a warning. However, it is good practice to have your code compile without warnings so Unreal has the compiler configured to treat warnings as errors so you are forced to deal with them. The warning is that the “item” variable you use as function parameter hides the class member “item” because it has the same name. Just name the function parameter something else like “otherItem”. It is also common for overloaded comparison operators to simply call the identifier on the right “rhs”.

---

_[View the full topic](https://forums.unrealengine.com/t/c-unreal-engine-4-error-c4458-please-help/263862)._
