Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export compiled_string so that user can customize one #3999

Merged
merged 1 commit into from
Jun 9, 2024
Merged
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
10 changes: 5 additions & 5 deletions include/fmt/compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#include "format.h"

FMT_BEGIN_NAMESPACE

// A compile-time string which is compiled into fast formatting code.
FMT_EXPORT class compiled_string {};

namespace detail {

template <typename T, typename InputIt>
Expand All @@ -23,9 +27,6 @@ FMT_CONSTEXPR inline auto copy(InputIt begin, InputIt end, counting_iterator it)
return it + (end - begin);
}

// A compile-time string which is compiled into fast formatting code.
class compiled_string {};

template <typename S>
struct is_compiled_string : std::is_base_of<compiled_string, S> {};

Expand All @@ -41,8 +42,7 @@ struct is_compiled_string : std::is_base_of<compiled_string, S> {};
* std::string s = fmt::format(FMT_COMPILE("{}"), 42);
*/
#if defined(__cpp_if_constexpr) && defined(__cpp_return_type_deduction)
# define FMT_COMPILE(s) \
FMT_STRING_IMPL(s, fmt::detail::compiled_string, explicit)
# define FMT_COMPILE(s) FMT_STRING_IMPL(s, fmt::compiled_string, explicit)
#else
# define FMT_COMPILE(s) FMT_STRING(s)
#endif
Expand Down
Loading