Do *not* export namespace detail

Introduce `FMT_BEGIN_DETAIL_NAMESPACE` and `FMT_END_DETAIL_NAMESPACE` for `namespace detail` sections embedded in that part of the code that contains all declarations that are exported from the module, i.e. which is enclosed by `FMT_MODULE_EXPORT_BEGIN` and `FMT_MODULE_EXPORT_END`. Given a correct implementation of C++20 modules, neither the name `fmt::detail` nor any of its contents will become visible outside of the module.
This commit is contained in:
Daniela Engert
2021-05-15 12:08:42 -07:00
committed by Victor Zverovich
parent 588bdb5404
commit 5466373a11
5 changed files with 49 additions and 46 deletions
+3 -4
View File
@@ -802,8 +802,7 @@ class FMT_API format_error : public std::runtime_error {
~format_error() FMT_NOEXCEPT FMT_OVERRIDE FMT_MSC_DEFAULT;
};
FMT_MODULE_EXPORT_END
namespace detail {
FMT_BEGIN_DETAIL_NAMESPACE
inline void throw_format_error(const char* message) {
FMT_THROW(format_error(message));
@@ -2534,8 +2533,8 @@ FMT_API void format_error_code(buffer<char>& out, int error_code,
FMT_API void report_error(format_func func, int error_code,
const char* message) FMT_NOEXCEPT;
} // namespace detail
FMT_MODULE_EXPORT_BEGIN
FMT_END_DETAIL_NAMESPACE
template <typename OutputIt, typename Char>
using arg_formatter FMT_DEPRECATED_ALIAS =