# C++ question. OVERRIDE macro purpose

**URL:** <https://forums.unrealengine.com/t/c-question-override-macro-purpose/3548>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [April 30, 2014, 2:06pm UTC](https://forums.unrealengine.com/t/c-question-override-macro-purpose/3548 "2014-04-30T14:06:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_69853c21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_69853c21](https://forums.unrealengine.com/u/anonymous_user_69853c21)\
**Post date:** [April 30, 2014, 2:06pm UTC](https://forums.unrealengine.com/t/c-question-override-macro-purpose/3548/1 "2014-04-30T14:06:37Z")

</div>

Hello. I came from different language but I’ve read several C++ books and can program with it. But of course in such big project as UE4 things much more complicated than in books. So, my first question: there’s OVERRIDE macro in engine. Tutorial says

> [@](#):
>
> The OVERRIDE macro has the same functionality as the C++11 keyword, but it allows for more portability

I put cursor on this word, pressed F12 and saw

> [@](#):
>
> #define OVERRIDE override

it’s in WIndowsPlatform.h. Also I checked AndroidPlatform.h, MacPlatform.h - always the same. So why does this keyword replaced? How does it allows more portability?

---

<div class="post-metadata">

**Author:** ![Artemis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Artemis](https://forums.unrealengine.com/u/Artemis)\
**Post date:** [April 30, 2014, 2:37pm UTC](https://forums.unrealengine.com/t/c-question-override-macro-purpose/3548/2 "2014-04-30T14:37:36Z")

</div>

I assume if they actually add additional functionality to it for a reason later on in UE4’s life then you won’t have to go back and change override to OVERRIDE everywhere. Just a guess though.

---

<div class="post-metadata">

**Author:** ![xgalaxy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xgalaxy](https://forums.unrealengine.com/u/xgalaxy)\
**Post date:** [April 30, 2014, 2:40pm UTC](https://forums.unrealengine.com/t/c-question-override-macro-purpose/3548/3 "2014-04-30T14:40:25Z")

</div>

Couple of reasons why this might be the case:

1. At the time they started developing the engine, the override decorator wasn’t supported on all the platforms / compilers they wanted to support. And now their macro is used everywhere throughout the code base it would be impractical to change it.

2. The XboxOne and/or PS4 supported compilers may not support it. Since you don’t have access to those platforms you may not see the macro being empty.

3. Additionally, any future platforms’ compilers may not support it, and so they use the macro for potential future compatibility.

---

<div class="post-metadata">

**Author:** ![Byooler](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Byooler](https://forums.unrealengine.com/u/Byooler)\
**Post date:** [April 30, 2014, 2:44pm UTC](https://forums.unrealengine.com/t/c-question-override-macro-purpose/3548/4 "2014-04-30T14:44:28Z")

</div>

We started using OVERRIDE before it was reliably supported all the compilers we cared about, so the macro was useful to avoid compilation problems in those cases. Nowadays that’s really not an issue and we use many other C++11 features regularly, but we’ve never gone back and updated it.
