Hacker News new | ask | show | jobs
by lklklkj2342487 3281 days ago
Isn't it what the standard compiler switch is for? For instance if your codebase builds fine with -std=c++17 and std::bind would have been removed in C++20, your code base would still compile fine because the compiler would figure it out.
1 comments

Unfortunately, that's hard in C++ because lots of code often ends up in headers because templated code must be in headers, and so then you can't link a C++17 and a C++20 library together (for example). Also, it's nice to be able to use new features without having to go and re-write lots of existing code.

It does however fix the basic problem of a complete program.

Hopefully, one day modules will fix this and we'll be able to link modules from different versions of C++ together, but I'm not holding my breath.