HACKER Q&A
📣 sunxfancy

Is there any tool can compile C++20 into C++11


As a C++ template library developer, I always wish my library could support in multiple scenarios with different compiler version. However, there are always old system that only have old compiler which may only support C++11. Is there a way that I can write code in C++20 but having a compiler compile it into C++11 standard so that my C++ template library can work with those old system/compilers? It doesn't need to be perfect; I can accept if some of the feature that is not possible to be converted (e.g. modules).


  👤 swah Accepted Answer ✓
I think that is called "transpiling" if it helps...

👤 b20000
just use c++11

you don’t need the new features