Download

C++ or c++11?

Hi, I’m a game artist so please excuse anything that might sound silly. :stuck_out_tongue:

So I found this cool series of tutorials that starts me out as a complete beginner to programming. The instructor is not exactly using UE4 in the series (yet), but he gives practical insights on what can be used in a game programming scenario, for the first half of his series. He said he will be using C++11 since it can be (in some cases) faster, and what I think he said becoming standard (or something of that nature).

So what I want to know is, if the majority of you guys/gals use C++ or C++11 in UE4? Is there even a difference using either one in UE4? Can I alternate between the two in the same project? Are there major/minor changes in the syntax, etc., that will make the learning curve steeper?

I thank you all for your help and feedback :slight_smile:

Yes, there is a difference. Using C++11 is fine to some extend. As UE4 supports many different platforms the question is if all used compilers for the different platforms support every feature of C++11. So there are features which are safe to use for all platforms and features which may cause issues on some.

See https://docs.unrealengine.com/latest/INT/Programming/Development/CodingStandard/index.html#c++11andmodernlanguagesyntax for more information.

C++ has a long history, going back to 1979 when it was called C with Classes. As it evolved, it has been standardized as an international standard by the ISO. There have been three standards: C++98 in 1998, C++03 in 2003 and C++11 in (you guessed it) 2011 and a technical report (C++TR1 in 2007). C++11 was refereed to C++0x or C++1x prior to it’s release and you’ll see that in older articles. The three standards have improved the language and there is a new standard in the works that’s currently refereed to as C++14. The Wiki C++ article has more details if you care.

UE4 is limited to a subset of C++11 that’s supported by Microsoft C++ 2013. The other two compilers that UE4 supports (GCC and Clang) both support full C++11, so the limit is MSVC++. Even so, the UE4 code base isn’t pushing the new features of C++, so you really don’t need to worry about them, unless your making change to the Engine source itself. You can use them as you need them, since it won’t affect portability. For example, I use lambdas a lot as they’re very useful for events and callbacks.

For you, I’d recommend focusing on the core c++ features and not worry to much about C++11.

Ahh, okay. That makes sense. Thanks for the input, I’ll read over the documentation link.

Thanks for the insightful feedback! Yes, I’ll have to agree. I should just focus on the core C++ for now. Thanks jCoder.

You guys are giving excellent advice.

I just wanted to mention that we’re actually limited by Visual C++ 2012 right now, not even 2013.

We are of course eager and quick to adopt the latest C++ features as we want the programmer experience with C++ to be as modern and unbounded as possible. Probably we’ll drop support for the 2012 compiler on Windows platform sometime soon, but runtime code is still limited by the Xbox One compiler which has not yet been updated to the 2013 standards. It’s just a matter of time. Meanwhile, feel free to use whatever C++ features you want on the platforms you intend to support for your products!

–Mike

I’m learning C++ and looking forward in the direction of Unreal Engine, just take a walk around. Switching from a game player to someone creating games is a sweet expectation:).