# How do I overload a TSet\<struct\> == operator?

**URL:** <https://forums.unrealengine.com/t/how-do-i-overload-a-tset-struct-operator/618343>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 31, 2022, 2:52pm UTC](https://forums.unrealengine.com/t/how-do-i-overload-a-tset-struct-operator/618343 "2022-07-31T14:52:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AceHigh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AceHigh](https://forums.unrealengine.com/u/AceHigh)\
**Post date:** [July 31, 2022, 2:52pm UTC](https://forums.unrealengine.com/t/how-do-i-overload-a-tset-struct-operator/618343/1 "2022-07-31T14:52:53Z")

</div>

Hi there. This is the code I am using:

```auto
TSet<TSet<Fpiece>> ply; //empty
TSet<Fpiece> p; // populated
TSet<FPiece> k;
for(auto x : p) k.Add(x);
ply.Add(k);

```

I have already overloaded the GetTypeHash function, however, when I compile in UE5 I get the error:  
`error C2678: binary '==': no operator found which takes a left-hand operand of type 'const T'`  
How do I resolve this?

---

<div class="post-metadata">

**Author:** ![AceHigh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AceHigh](https://forums.unrealengine.com/u/AceHigh)\
**Post date:** [July 31, 2022, 3:58pm UTC](https://forums.unrealengine.com/t/how-do-i-overload-a-tset-struct-operator/618343/2 "2022-07-31T15:58:23Z")

</div>

OK so simple workaround. I changed `TSet<TSet<Fpiece>>` to `std::list<TSet<Fpiece>>` and it compiled. Don’t know if I will get the same performance as I would with a `TSet` but we will see.
