Add FMT_CUSTOM_ASSERT_FAIL (#4505)

That way one can provide ones own implementation for assert_fail, which
is moved out of the detail namespace. For binary compatibility the
detail version stays to call the outer version.
This commit is contained in:
Björn Schäpers
2025-08-25 09:02:00 -07:00
committed by GitHub
parent 43c88d00ae
commit e181e94140
3 changed files with 14 additions and 4 deletions
+1 -2
View File
@@ -170,8 +170,7 @@ template <typename T> struct iterator_traits<fmt::basic_appender<T>> {
#elif FMT_USE_EXCEPTIONS
# define FMT_THROW(x) throw x
#else
# define FMT_THROW(x) \
::fmt::detail::assert_fail(__FILE__, __LINE__, (x).what())
# define FMT_THROW(x) ::fmt::assert_fail(__FILE__, __LINE__, (x).what())
#endif
// Defining FMT_REDUCE_INT_INSTANTIATIONS to 1, will reduce the number of