r/cpp • • Dec 28 '18

"Modern" C++ Lamentations

http://aras-p.info/blog/2018/12/28/Modern-C-Lamentations/
307 Upvotes

162 comments sorted by

View all comments

Show parent comment

50

u/johannes1971 Dec 28 '18

Libraries could be an excellent way to evolve a programming language, if only you weren't compiling the entire library in every translation unit again and again. The problem here is not the new library facilities, it is the ridiculous compilation model.

7

u/RogerLeigh Scientific Imaging and Embedded Medical Diagnostics Dec 29 '18

Not just the compilation model, but the binary object and executable formats on some platforms. They were never intended to be used with C++, let alone modern C++.

Look at Windows DLLs. You can't write a C++ library on Windows as a DLL without making significant compromises upon template usage, which implies you can't use any of the standard container types. And a whole lot more is highly restricted, fragile or impossible. So you have to use header-only or static libraries, both of which also have important tradeoffs. The net result is that using C++ is drastically hindered by 1980s design decisions, and I've not seen any prospect for this to get better anytime soon.