Skip to content

Commit

Permalink
Export compiled_string so that user can customize one
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Jun 9, 2024
1 parent 2bf811b commit 64cf1fd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions include/fmt/compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
#include "format.h"

FMT_BEGIN_NAMESPACE

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

namespace detail {

template <typename T, typename InputIt>
Expand All @@ -23,9 +29,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 @@ -42,7 +45,7 @@ struct is_compiled_string : std::is_base_of<compiled_string, S> {};
*/
#if defined(__cpp_if_constexpr) && defined(__cpp_return_type_deduction)
# define FMT_COMPILE(s) \
FMT_STRING_IMPL(s, fmt::detail::compiled_string, explicit)
FMT_STRING_IMPL(s, fmt::compiled_string, explicit)
#else
# define FMT_COMPILE(s) FMT_STRING(s)
#endif
Expand Down

0 comments on commit 64cf1fd

Please sign in to comment.