Previously, assertions could only be enabled if the library was configured
to include support for the Debug mode. This patch unconditionally adds the
very small amount of code needed to support assertions (and assertions
only, not the whole iterator debugging functionality) to the shared library.
This means that users can turn assertions on in their code regardless of
how the library was configured, which makes it a true user-facing knob.
I think this makes sense, just like we allow users to decide whether
assert() is enabled or not.
If they don't enable assertions in their code, nothing changes compared
to before this patch, except the shared library will now be a tiny bit
larger than it used to be. In my opinion, this is insignificant compared
to the benefit of being able to turn assertions on, and it's not even
worth the complexity to provide a knob to turn that part off.
Also note that technically, functions compiled inside the shared library
may or may not have assertions enabled, depending on whether the vendor
configured the library with LIBCXX_ENABLE_ASSERTIONS when building.
This can lead to ODR violations, however I think those are all benign.
Finally, since we're adding symbols to the shared library, this means
that this feature won't be available when linking against older dylibs,
hence the accompanying availability markup.