mirror of
https://github.com/fmtlib/fmt.git
synced 2024-10-02 04:52:03 +00:00
Tag official API for module export (#2235)
* functions * classes * UDLs * other declarations Export everything in namespace 'fmt' from core.h and format.h
This commit is contained in:
parent
d8910af80d
commit
f4bbc54cc4
@ -289,6 +289,8 @@ inline null<> gmtime_r(...) { return null<>(); }
|
|||||||
inline null<> gmtime_s(...) { return null<>(); }
|
inline null<> gmtime_s(...) { return null<>(); }
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Converts given time since epoch as ``std::time_t`` value into calendar time,
|
Converts given time since epoch as ``std::time_t`` value into calendar time,
|
||||||
expressed in local time. Unlike ``std::localtime``, this function is
|
expressed in local time. Unlike ``std::localtime``, this function is
|
||||||
@ -380,6 +382,8 @@ inline std::tm gmtime(
|
|||||||
return gmtime(std::chrono::system_clock::to_time_t(time_point));
|
return gmtime(std::chrono::system_clock::to_time_t(time_point));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
inline size_t strftime(char* str, size_t count, const char* format,
|
inline size_t strftime(char* str, size_t count, const char* format,
|
||||||
const std::tm* time) {
|
const std::tm* time) {
|
||||||
@ -401,6 +405,8 @@ inline size_t strftime(wchar_t* str, size_t count, const wchar_t* format,
|
|||||||
}
|
}
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
template <typename Char, typename Duration>
|
template <typename Char, typename Duration>
|
||||||
struct formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
|
struct formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
|
||||||
Char> : formatter<std::tm, Char> {
|
Char> : formatter<std::tm, Char> {
|
||||||
@ -1185,6 +1191,7 @@ struct formatter<std::chrono::duration<Rep, Period>, Char> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // FMT_CHRONO_H_
|
#endif // FMT_CHRONO_H_
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
FMT_BEGIN_NAMESPACE
|
FMT_BEGIN_NAMESPACE
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
enum class color : uint32_t {
|
enum class color : uint32_t {
|
||||||
alice_blue = 0xF0F8FF, // rgb(240,248,255)
|
alice_blue = 0xF0F8FF, // rgb(240,248,255)
|
||||||
@ -205,6 +206,7 @@ struct rgb {
|
|||||||
uint8_t b;
|
uint8_t b;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
// color is a struct of either a rgb color or a terminal color.
|
// color is a struct of either a rgb color or a terminal color.
|
||||||
@ -229,6 +231,7 @@ struct color_type {
|
|||||||
} value;
|
} value;
|
||||||
};
|
};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
/** A text style consisting of foreground and background colors and emphasis. */
|
/** A text style consisting of foreground and background colors and emphasis. */
|
||||||
class text_style {
|
class text_style {
|
||||||
@ -367,6 +370,7 @@ FMT_CONSTEXPR inline text_style operator|(emphasis lhs,
|
|||||||
return text_style(lhs) | rhs;
|
return text_style(lhs) | rhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template <typename Char> struct ansi_color_escape {
|
template <typename Char> struct ansi_color_escape {
|
||||||
@ -510,6 +514,7 @@ void vformat_to(buffer<Char>& buf, const text_style& ts,
|
|||||||
if (has_style) detail::reset_color<Char>(buf);
|
if (has_style) detail::reset_color<Char>(buf);
|
||||||
}
|
}
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
template <typename S, typename Char = char_t<S>>
|
template <typename S, typename Char = char_t<S>>
|
||||||
void vprint(std::FILE* f, const text_style& ts, const S& format,
|
void vprint(std::FILE* f, const text_style& ts, const S& format,
|
||||||
@ -619,6 +624,7 @@ inline auto format_to(OutputIt out, const text_style& ts, const S& format_str,
|
|||||||
fmt::make_args_checked<Args...>(format_str, args...));
|
fmt::make_args_checked<Args...>(format_str, args...));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // FMT_COLOR_H_
|
#endif // FMT_COLOR_H_
|
||||||
|
@ -816,6 +816,8 @@ FMT_DEPRECATED auto compile(const Args&... args)
|
|||||||
return detail::compile(args...);
|
return detail::compile(args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
#if FMT_USE_CONSTEXPR
|
#if FMT_USE_CONSTEXPR
|
||||||
# ifdef __cpp_if_constexpr
|
# ifdef __cpp_if_constexpr
|
||||||
|
|
||||||
@ -953,6 +955,7 @@ operator""_cf() {
|
|||||||
} // namespace literals
|
} // namespace literals
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // FMT_COMPILE_H_
|
#endif // FMT_COMPILE_H_
|
||||||
|
@ -204,6 +204,16 @@
|
|||||||
FMT_INLINE_NAMESPACE v7 {
|
FMT_INLINE_NAMESPACE v7 {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef FMT_MODULE_EXPORT
|
||||||
|
# define FMT_MODULE_EXPORT
|
||||||
|
#endif
|
||||||
|
#ifndef FMT_MODULE_EXPORT_BEGIN
|
||||||
|
# define FMT_MODULE_EXPORT_BEGIN
|
||||||
|
#endif
|
||||||
|
#ifndef FMT_MODULE_EXPORT_END
|
||||||
|
# define FMT_MODULE_EXPORT_END
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
|
#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
|
||||||
# define FMT_CLASS_API FMT_MSC_WARNING(suppress : 4275)
|
# define FMT_CLASS_API FMT_MSC_WARNING(suppress : 4275)
|
||||||
# ifdef FMT_EXPORT
|
# ifdef FMT_EXPORT
|
||||||
@ -370,6 +380,8 @@ namespace internal = detail; // DEPRECATED
|
|||||||
compiled with a different ``-std`` option than the client code (which is not
|
compiled with a different ``-std`` option than the client code (which is not
|
||||||
recommended).
|
recommended).
|
||||||
*/
|
*/
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
template <typename Char> class basic_string_view {
|
template <typename Char> class basic_string_view {
|
||||||
private:
|
private:
|
||||||
const Char* data_;
|
const Char* data_;
|
||||||
@ -523,6 +535,7 @@ constexpr basic_string_view<typename S::char_type> to_string_view(const S& s) {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
namespace detail {
|
namespace detail {
|
||||||
void to_string_view(...);
|
void to_string_view(...);
|
||||||
using fmt::v7::to_string_view;
|
using fmt::v7::to_string_view;
|
||||||
@ -560,6 +573,7 @@ struct error_handler {
|
|||||||
FMT_NORETURN FMT_API void on_error(const char* message);
|
FMT_NORETURN FMT_API void on_error(const char* message);
|
||||||
};
|
};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
/** String's character type. */
|
/** String's character type. */
|
||||||
template <typename S> using char_t = typename detail::char_t_impl<S>::type;
|
template <typename S> using char_t = typename detail::char_t_impl<S>::type;
|
||||||
@ -668,6 +682,7 @@ template <typename T> struct is_contiguous : std::false_type {};
|
|||||||
template <typename Char>
|
template <typename Char>
|
||||||
struct is_contiguous<std::basic_string<Char>> : std::true_type {};
|
struct is_contiguous<std::basic_string<Char>> : std::true_type {};
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
// Extracts a reference to the container from back_insert_iterator.
|
// Extracts a reference to the container from back_insert_iterator.
|
||||||
@ -1285,6 +1300,7 @@ enum { max_packed_args = 62 / packed_arg_bits };
|
|||||||
enum : unsigned long long { is_unpacked_bit = 1ULL << 63 };
|
enum : unsigned long long { is_unpacked_bit = 1ULL << 63 };
|
||||||
enum : unsigned long long { has_named_args_bit = 1ULL << 62 };
|
enum : unsigned long long { has_named_args_bit = 1ULL << 62 };
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
// A formatting argument. It is a trivially copyable/constructible type to
|
// A formatting argument. It is a trivially copyable/constructible type to
|
||||||
// allow storage in basic_memory_buffer.
|
// allow storage in basic_memory_buffer.
|
||||||
@ -1394,6 +1410,7 @@ FMT_CONSTEXPR_DECL FMT_INLINE auto visit_format_arg(
|
|||||||
return vis(monostate());
|
return vis(monostate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 500
|
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 500
|
||||||
@ -1480,6 +1497,7 @@ inline basic_format_arg<Context> make_arg(const T& value) {
|
|||||||
return make_arg<Context>(value);
|
return make_arg<Context>(value);
|
||||||
}
|
}
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
// Formatting context.
|
// Formatting context.
|
||||||
template <typename OutputIt, typename Char> class basic_format_context {
|
template <typename OutputIt, typename Char> class basic_format_context {
|
||||||
@ -1536,10 +1554,14 @@ using buffer_context =
|
|||||||
using format_context = buffer_context<char>;
|
using format_context = buffer_context<char>;
|
||||||
using wformat_context = buffer_context<wchar_t>;
|
using wformat_context = buffer_context<wchar_t>;
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
|
|
||||||
// Workaround an alias issue: https://stackoverflow.com/q/62767544/471164.
|
// Workaround an alias issue: https://stackoverflow.com/q/62767544/471164.
|
||||||
#define FMT_BUFFER_CONTEXT(Char) \
|
#define FMT_BUFFER_CONTEXT(Char) \
|
||||||
basic_format_context<detail::buffer_appender<Char>, Char>
|
basic_format_context<detail::buffer_appender<Char>, Char>
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
template <typename T, typename Char = char>
|
template <typename T, typename Char = char>
|
||||||
using is_formattable = bool_constant<!std::is_same<
|
using is_formattable = bool_constant<!std::is_same<
|
||||||
decltype(detail::arg_mapper<buffer_context<Char>>().map(std::declval<T>())),
|
decltype(detail::arg_mapper<buffer_context<Char>>().map(std::declval<T>())),
|
||||||
@ -1782,6 +1804,7 @@ struct wformat_args : basic_format_args<wformat_context> {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template <typename Char, FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
|
template <typename Char, FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
|
||||||
@ -1806,6 +1829,7 @@ FMT_API void vprint_mojibake(std::FILE*, string_view, format_args);
|
|||||||
inline void vprint_mojibake(std::FILE*, string_view, format_args) {}
|
inline void vprint_mojibake(std::FILE*, string_view, format_args) {}
|
||||||
#endif
|
#endif
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
/** Formats a string and writes the output to ``out``. */
|
/** Formats a string and writes the output to ``out``. */
|
||||||
// GCC 8 and earlier cannot handle std::back_insert_iterator<Container> with
|
// GCC 8 and earlier cannot handle std::back_insert_iterator<Container> with
|
||||||
@ -1954,6 +1978,8 @@ inline void print(const S& format_str, Args&&... args) {
|
|||||||
: detail::vprint_mojibake(stdout, to_string_view(format_str),
|
: detail::vprint_mojibake(stdout, to_string_view(format_str),
|
||||||
vargs);
|
vargs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
FMT_GCC_PRAGMA("GCC pop_options")
|
FMT_GCC_PRAGMA("GCC pop_options")
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -692,6 +692,8 @@ void iterator_buffer<OutputIt, T, Traits>::flush() {
|
|||||||
}
|
}
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
// The number of characters to store in the basic_memory_buffer object itself
|
// The number of characters to store in the basic_memory_buffer object itself
|
||||||
// to avoid dynamic memory allocation.
|
// to avoid dynamic memory allocation.
|
||||||
enum { inline_buffer_size = 500 };
|
enum { inline_buffer_size = 500 };
|
||||||
@ -859,6 +861,7 @@ class FMT_API format_error : public std::runtime_error {
|
|||||||
~format_error() FMT_NOEXCEPT FMT_OVERRIDE;
|
~format_error() FMT_NOEXCEPT FMT_OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -1255,7 +1258,7 @@ template <typename Char> struct fill_t {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
// We cannot use enum classes as bit fields because of a gcc bug
|
// We cannot use enum classes as bit fields because of a gcc bug
|
||||||
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414.
|
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414.
|
||||||
namespace align {
|
namespace align {
|
||||||
@ -1291,6 +1294,7 @@ template <typename Char> struct basic_format_specs {
|
|||||||
|
|
||||||
using format_specs = basic_format_specs<char>;
|
using format_specs = basic_format_specs<char>;
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace dragonbox {
|
namespace dragonbox {
|
||||||
|
|
||||||
@ -3305,6 +3309,7 @@ FMT_API void format_error_code(buffer<char>& out, int error_code,
|
|||||||
FMT_API void report_error(format_func func, int error_code,
|
FMT_API void report_error(format_func func, int error_code,
|
||||||
string_view message) FMT_NOEXCEPT;
|
string_view message) FMT_NOEXCEPT;
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
template <typename OutputIt, typename Char>
|
template <typename OutputIt, typename Char>
|
||||||
using arg_formatter FMT_DEPRECATED_ALIAS =
|
using arg_formatter FMT_DEPRECATED_ALIAS =
|
||||||
@ -3833,6 +3838,8 @@ std::basic_string<Char> to_string(const basic_memory_buffer<Char, SIZE>& buf) {
|
|||||||
return std::basic_string<Char>(buf.data(), size);
|
return std::basic_string<Char>(buf.data(), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
|
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
void detail::vformat_to(
|
void detail::vformat_to(
|
||||||
detail::buffer<Char>& buf, basic_string_view<Char> format_str,
|
detail::buffer<Char>& buf, basic_string_view<Char> format_str,
|
||||||
@ -3881,6 +3888,8 @@ extern template int snprintf_float<long double>(long double value,
|
|||||||
} // namespace detail
|
} // namespace detail
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
template <typename S, typename Char = char_t<S>,
|
template <typename S, typename Char = char_t<S>,
|
||||||
FMT_ENABLE_IF(detail::is_string<S>::value)>
|
FMT_ENABLE_IF(detail::is_string<S>::value)>
|
||||||
inline void vformat_to(
|
inline void vformat_to(
|
||||||
@ -3965,6 +3974,7 @@ void vprint(basic_string_view<Char> format_str, wformat_args args) {
|
|||||||
vprint(stdout, format_str, args);
|
vprint(stdout, format_str, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
#if FMT_USE_USER_DEFINED_LITERALS
|
#if FMT_USE_USER_DEFINED_LITERALS
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template <typename Char> struct udl_formatter {
|
template <typename Char> struct udl_formatter {
|
||||||
@ -3984,6 +3994,7 @@ template <typename Char> struct udl_arg {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
inline namespace literals {
|
inline namespace literals {
|
||||||
/**
|
/**
|
||||||
@ -4022,6 +4033,8 @@ constexpr detail::udl_arg<wchar_t> operator"" _a(const wchar_t* s, size_t) {
|
|||||||
return {s};
|
return {s};
|
||||||
}
|
}
|
||||||
} // namespace literals
|
} // namespace literals
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
#endif // FMT_USE_USER_DEFINED_LITERALS
|
#endif // FMT_USE_USER_DEFINED_LITERALS
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@ std::basic_string<Char> vformat(
|
|||||||
}
|
}
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
template <typename S, typename Char = char_t<S>>
|
template <typename S, typename Char = char_t<S>>
|
||||||
inline std::basic_string<Char> vformat(
|
inline std::basic_string<Char> vformat(
|
||||||
const std::locale& loc, const S& format_str,
|
const std::locale& loc, const S& format_str,
|
||||||
@ -59,6 +61,7 @@ inline auto format_to(OutputIt out, const std::locale& loc, const S& format_str,
|
|||||||
return vformat_to(out, loc, to_string_view(format_str), vargs);
|
return vformat_to(out, loc, to_string_view(format_str), vargs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // FMT_LOCALE_H_
|
#endif // FMT_LOCALE_H_
|
||||||
|
@ -14,9 +14,13 @@
|
|||||||
|
|
||||||
FMT_BEGIN_NAMESPACE
|
FMT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
template <typename Char> class basic_printf_parse_context;
|
template <typename Char> class basic_printf_parse_context;
|
||||||
template <typename OutputIt, typename Char> class basic_printf_context;
|
template <typename OutputIt, typename Char> class basic_printf_context;
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template <class Char> class formatbuf : public std::basic_streambuf<Char> {
|
template <class Char> class formatbuf : public std::basic_streambuf<Char> {
|
||||||
@ -151,6 +155,7 @@ struct fallback_formatter<T, Char, enable_if_t<is_streamable<T, Char>::value>>
|
|||||||
};
|
};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
void vprint(std::basic_ostream<Char>& os, basic_string_view<Char> format_str,
|
void vprint(std::basic_ostream<Char>& os, basic_string_view<Char> format_str,
|
||||||
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
|
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
|
||||||
@ -168,6 +173,7 @@ void vprint(std::basic_ostream<Char>& os, basic_string_view<Char> format_str,
|
|||||||
fmt::print(cerr, "Don't {}!", "panic");
|
fmt::print(cerr, "Don't {}!", "panic");
|
||||||
\endrst
|
\endrst
|
||||||
*/
|
*/
|
||||||
|
FMT_MODULE_EXPORT
|
||||||
template <typename S, typename... Args,
|
template <typename S, typename... Args,
|
||||||
typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
|
typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
|
||||||
void print(std::basic_ostream<Char>& os, const S& format_str, Args&&... args) {
|
void print(std::basic_ostream<Char>& os, const S& format_str, Args&&... args) {
|
||||||
|
@ -194,6 +194,7 @@ FMT_DEPRECATED void printf(detail::buffer<Char>& buf,
|
|||||||
}
|
}
|
||||||
using detail::vprintf;
|
using detail::vprintf;
|
||||||
|
|
||||||
|
// already exported through "ostream.h" above
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
class basic_printf_parse_context : public basic_format_parse_context<Char> {
|
class basic_printf_parse_context : public basic_format_parse_context<Char> {
|
||||||
using basic_format_parse_context<Char>::basic_format_parse_context;
|
using basic_format_parse_context<Char>::basic_format_parse_context;
|
||||||
@ -567,6 +568,8 @@ OutputIt basic_printf_context<OutputIt, Char>::format() {
|
|||||||
out, basic_string_view<Char>(start, detail::to_unsigned(it - start)));
|
out, basic_string_view<Char>(start, detail::to_unsigned(it - start)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
using basic_printf_context_t =
|
using basic_printf_context_t =
|
||||||
basic_printf_context<detail::buffer_appender<Char>, Char>;
|
basic_printf_context<detail::buffer_appender<Char>, Char>;
|
||||||
@ -717,6 +720,8 @@ inline int fprintf(std::basic_ostream<Char>& os, const S& format_str,
|
|||||||
return vfprintf(os, to_string_view(format_str),
|
return vfprintf(os, to_string_view(format_str),
|
||||||
make_format_args<context>(args...));
|
make_format_args<context>(args...));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // FMT_PRINTF_H_
|
#endif // FMT_PRINTF_H_
|
||||||
|
@ -422,6 +422,8 @@ struct formatter<tuple_arg_join<Char, T...>, Char> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\rst
|
\rst
|
||||||
Returns an object that formats `tuple` with elements separated by `sep`.
|
Returns an object that formats `tuple` with elements separated by `sep`.
|
||||||
@ -468,6 +470,7 @@ arg_join<const T*, const T*, wchar_t> join(std::initializer_list<T> list,
|
|||||||
return join(std::begin(list), std::end(list), sep);
|
return join(std::begin(list), std::end(list), sep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FMT_MODULE_EXPORT_END
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // FMT_RANGES_H_
|
#endif // FMT_RANGES_H_
|
||||||
|
Loading…
Reference in New Issue
Block a user