4 ms·
When written with discipline C++ is very portable. I've worked on codebases that spanned devices with ~8mb of memory to full-blown desktop PC and arches(x86/MIP
by vvanders 10y ago
When written with discipline C++ is very portable. I've worked on codebases that spanned devices with ~8mb of memory to full-blown desktop PC and arches(x86/MIPS/ARM/PPC just to name a few).
- raverbashing 10y agoAcross devices it seems it is very portable. Now, across compiler vendors and versions it is hard
- Impossible 10y agoGenerally speaking when you are targeting that wide of a range of devices you are targeting a wide range of compilers. It requires some discipline but it's far from the hardest thing in the world assuming you are regularly building and testing for all platforms. I'd say that most major C++ applications or libraries compile in Clang, GCC and MSVC without issue and often build for less common targets as well (icc, nvcc for cuda support, etc.) Things definitely get harder when you move to weirder embedded platforms.
- vvanders 10y agoYup, we targeted GCC, MSVC, plus a few proprietary compilers. As long as you stick to a reasonable set of features(which you should anyway for sanity reasons) it works pretty well. Having a good CI is a must though but it's not nearly as hard as porting an old codebase backwards.
- pjmlp 10y agoWriting with discipline is a synonym for writing castrated C++, to avoid touching language features not yet implemented or with slight semantic differences across compilers. One of the things that attracted me to Java was that I finally could write something where I could use 100% of language features and actually use it everywhere. C++17 is around the corner, yet most embedded, mainframe and commercial UNIX vendors are between C++11 and C++14, in the few cases where they already support anything from C++14. Then there are the UB and implementation defined differences across those compilers.