# Operator Overloading

**URL:** <https://forums.unrealengine.com/t/operator-overloading/298784>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 11, 2014, 10:24pm UTC](https://forums.unrealengine.com/t/operator-overloading/298784 "2014-11-11T22:24:41Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [November 12, 2014, 12:41pm UTC](https://forums.unrealengine.com/t/operator-overloading/298784/4 "2014-11-12T12:41:31Z")

</div>

#Solusion

You shouldn’t put operator overloads in .cpp files, just keep it in the .h

```
//some .h file that stores all your operators
FORCEINLINE FString& operator<<(FString &Str, const int32& Value)
 {
     Str += FString::FromInt(Value);
     return Str;
 }

```

and put in in a .h file that is included in every class that needs to use the operator

#UObject Static Function Library

An ideal place to put operators is in a .h file that is a static function library where you store all your core custom code, which is then included in all your major game class .h files.

#Wiki on Static Function Libraries

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

🙂

RAma

---

_[View the full topic](https://forums.unrealengine.com/t/operator-overloading/298784)._
