Why not C++11 as the minimum requirement? #3890
Replies: 4 comments 3 replies
-
I love modern C++ a lot, but I think that Dear ImGui won't benefit from it much. The only thing I can think of is using If there are any examples where modern C++ will make some code better, I'd like to see them. But otherwise, I think that it would be good if someone could write a "wrapper" library around ImGui which implements modern C++ API with template magic, RAII wrappers for |
Beta Was this translation helpful? Give feedback.
-
Stephanos thanks for asking and being curious. Traditionally the reason for that friction in pro game development is that the need to haves game running on non-traditional architectures means compilers are rarely standard or latest versions. Many "modern-ish" C++ features also have performances properties (either runtime or compilation-time) that not-acceptable for AAA developers, or dependencies that are not acceptable either. Lots of established tech wouldn't be able to use Dear ImGui if it required recent versions or dragged dependencies. Many AAA gamedev would never even consider dear imgui if it used e.g. std::string (of course that's not the core of your question, but it stills gives an element of answer). Lots of homebrew projects are also stuck with old toolsets and don't want to upgrade. New programmers are notoriously less agile, so less able to change toolsets. As we are shipping a LIBRARY, is not our role to require people to upgrade especially as in many situations they simply cannot. When I'm working on a private project which I have control of, I can use newer features, as many game developers today I uses features from C++11 and onwards when I can, but Dear ImGui is less a place for it. That said I think we will probably up the compiler requirements of Dear ImGui sometimes this year to align with a subset of C++11, so we can benefit from a few extra compilers and low-level header features.
Well, what are they? |
Beta Was this translation helpful? Give feedback.
-
You are right, but also unfortunately modern C++ insistence in over-complicatedly making things "libraries" (part of headers) instead of defining them in the language, means that some features which should be language features instead depends on C++ headers (I think that's the case for initializer list), and those are becoming increasingly hard to trust long-term. Right now my "minimum build target" in mind has been VS2010 and I worked with those constraints. May up that to 2013 soon since that's the time were they added better support for C++11 features. My question was most "do you have specific use in mind" for use? |
Beta Was this translation helpful? Give feedback.
-
I often work with development environments tested and created for specific hardware platform more than 10 years ago, sometimes much more. Industrial stuff lives often long time. Rewriting and testing board support, etc to production level, is expensive and lengthy project. In practice requiring upgrade to newest tools would prevent using the library, or freeze it to latest backwards compatible version. This would not only prevent update library in old designs, but also in new ones which need to share code with the old ones. In my view, benefits of using C++11 are cosmetic. Small part of code would look neater, but that is all. |
Beta Was this translation helpful? Give feedback.
-
Out of sheer curiosity, how come it's not C++11 the minimum requirement to coding implementation?
There are things that I personally think could help with the project's development as a whole.
I'm not saying to use the entire C++11 standard; far from it!
Only those features the project may actually need.
For instance, I read a bit of the code and wondered how much cleaner the logic would be with lambdas wherever applicable.
The same goes for with the use of
constexpr
,auto
, and maybe somewhere thedecltype
.Of course, you know best why you choose to stick with a subset of C++; let's call it C++Lite...-ish 😆
Can you enlighten me please with your reasoning so I learn more how an experienced Graphics Developer thinks?
Beta Was this translation helpful? Give feedback.
All reactions