On 13/02/2018 21:05, Olaf van der Spek wrote:
On Tue, Feb 13, 2018 at 12:21 AM, Gavin Lambert wrote:
(Header-only and highly templated libraries can be the worst offenders in this regard: it only takes one translation unit compiled with slightly different settings to break seemingly unrelated code, sometimes apparently at random if the linker picks different ones to keep each time. Compiled libraries at least have the option of supplying both C++03 and C++11 implementations in separate namespaces, though it can become a game of whack-a-mole to enumerate all the different ABI-breaking settings that you want to concurrently support.)
Why can header-only libs not use different namespaces for 03 and 11?
They can, but it's a little trickier since you will only get the C++03 implementation if someone actually compiles a translation unit in C++03 mode. (Though that's not a bad thing.)