Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,14 @@ template <typename T> class buffer {
}
};

#if FMT_MSC_VERSION
# ifdef FMT_EXPORT
extern template class buffer<char>;
# else
template class FMT_API buffer<char>;
# endif
#endif

struct buffer_traits {
explicit buffer_traits(size_t) {}
auto count() const -> size_t { return 0; }
Expand Down
7 changes: 7 additions & 0 deletions src/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ template FMT_API auto locale_ref::get<std::locale>() const -> std::locale;

// Explicit instantiations for char.

#if FMT_MSC_VERSION
// fmt::ostream does it implicitly, so we need make it explicitly.
// Otherwise we get ODR violation when {fmt} is built as a shared library
// and fmt/os.h is not included by the user.
template class FMT_API buffer<char>;
#endif

template FMT_API auto thousands_sep_impl(locale_ref)
-> thousands_sep_result<char>;
template FMT_API auto decimal_point_impl(locale_ref) -> char;
Expand Down