llvm-project/libcxx/src/vector.cpp
Nikolas Klauser 484ee42096
[libc++] Introduce the notion of a minimum header version (#166074)
Introducing the notion of a minimum header version has multiple
benefits. It allows us to merge a bunch of ABI macros into a single one.
This makes configuring the library significantly easier, since, for a
stable ABI, you only need to know which version you started distributing
the library with, instead of checking which ABI flags have been
introduced at what point. For platforms which have a moving window of
the minimum version a program has been compiled against, this also makes
it simple to remove symbols from the dylib when they can't be used by
any program anymore.
2026-01-09 11:58:29 +01:00

31 lines
1016 B
C++

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <vector>
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 15
template <bool>
struct __vector_base_common;
template <>
struct __vector_base_common<true> {
[[noreturn]] _LIBCPP_EXPORTED_FROM_ABI void __throw_length_error() const;
[[noreturn]] _LIBCPP_EXPORTED_FROM_ABI void __throw_out_of_range() const;
};
void __vector_base_common<true>::__throw_length_error() const { std::__throw_length_error("vector"); }
void __vector_base_common<true>::__throw_out_of_range() const { std::__throw_out_of_range("vector"); }
#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 15
_LIBCPP_END_NAMESPACE_STD