Am So., 2. Juni 2019 um 19:18 Uhr schrieb Thiago Macieira <thiago.macie...@intel.com>: > > On Sunday, 2 June 2019 01:20:51 PDT Manuel Bergler wrote: > > First of all, Qt itself > > could make use of inline namespaces to ship several version of the same > > classes in the same binary while keeping source compatibility. > > Repeat after me: inline namespaces are not a tool to retain ABI.
Of course they are. That's the reason they were introduced [0]: To allow symbol versioning as part of the language without having to write linker scripts, thus enabling standard library vendors to ship both C++98 and C++11 conforming versions of the standard library types in the same binary. > They may allow the library to provide both ABIs. That only makes the breakage > move to the next library that uses those classes. The use itself is not the problem, only using them in public interfaces will cause problems. But in that case inline namespaces also allow users that are not able to update such a library to explicitly request the old version by fully qualifying the type (e.g. ::v61::QString instead of just QString). It would also be possible to create a feature toggle macro similar to libstdc++'s _GLIBCXX_USE_CXX11_ABI to automatically switch which namespace becomes the default one, but I'd not do that as this will incentivize users not to update to the newer version. Best Manuel [0] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development