diff --git a/include/fmt/compile.h b/include/fmt/compile.h index ab1ee2bb..5b8d2d0d 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -12,6 +12,7 @@ #include "format.h" FMT_BEGIN_NAMESPACE +namespace internal { template struct format_part { public: @@ -96,7 +97,6 @@ template struct format_part { } val; }; -namespace internal { template class format_preparation_handler : public internal::error_handler { private: diff --git a/test/compile-test.cc b/test/compile-test.cc index a5c086fd..8a8f1b93 100644 --- a/test/compile-test.cc +++ b/test/compile-test.cc @@ -36,12 +36,13 @@ using testing::StrictMock; class mock_parts_collector { public: - MOCK_METHOD1(add, void(fmt::format_part)); - MOCK_METHOD1(substitute_last, void(fmt::format_part)); - MOCK_METHOD0(last, fmt::format_part()); + MOCK_METHOD1(add, void(fmt::internal::format_part)); + MOCK_METHOD1(substitute_last, void(fmt::internal::format_part)); + MOCK_METHOD0(last, fmt::internal::format_part()); }; FMT_BEGIN_NAMESPACE +namespace internal { bool operator==(const internal::string_view_metadata& lhs, const internal::string_view_metadata& rhs) { return std::tie(lhs.offset_, lhs.size_) == std::tie(rhs.offset_, rhs.size_); @@ -85,7 +86,7 @@ bool operator!=(const format_part::specification& lhs, } bool operator==(const format_part& lhs, - const fmt::format_part& rhs) { + const fmt::internal::format_part& rhs) { typedef format_part::which_value which_value; if (lhs.which != rhs.which || @@ -114,14 +115,15 @@ bool operator==(const format_part& lhs, return false; } -bool operator!=(const fmt::format_part& lhs, - const fmt::format_part& rhs) { +bool operator!=(const fmt::internal::format_part& lhs, + const fmt::internal::format_part& rhs) { return !(lhs == rhs); } +} FMT_END_NAMESPACE TEST(PrepareTest, FormatPart_ComparisonOperators) { - typedef fmt::format_part format_part; + typedef fmt::internal::format_part format_part; typedef fmt::internal::dynamic_format_specs prepared_specs; { @@ -226,7 +228,7 @@ TEST(PrepareTest, FormatPart_ComparisonOperators) { } TEST(PrepareTest, FormatPreparationHandler_OnText_AddsPartWithText) { - typedef fmt::format_part format_part; + typedef fmt::internal::format_part format_part; typedef StrictMock parts_mock; parts_mock parts; @@ -242,7 +244,7 @@ TEST(PrepareTest, FormatPreparationHandler_OnText_AddsPartWithText) { } TEST(PrepareTest, FormatPreparationHandler_OnArgId_AddsPartWithIncrementedId) { - typedef fmt::format_part format_part; + typedef fmt::internal::format_part format_part; typedef StrictMock parts_mock; parts_mock parts; @@ -260,7 +262,7 @@ TEST(PrepareTest, FormatPreparationHandler_OnArgId_AddsPartWithIncrementedId) { } TEST(PrepareTest, FormatPreparationHandler_OnArgId_AddsPartWithPassedId) { - typedef fmt::format_part format_part; + typedef fmt::internal::format_part format_part; typedef StrictMock parts_mock; parts_mock parts; @@ -281,7 +283,7 @@ TEST(PrepareTest, FormatPreparationHandler_OnArgId_AddsPartWithPassedId) { } TEST(PrepareTest, FormatPreparationHandler_OnArgId_AddsPartWithPassedNamedId) { - typedef fmt::format_part format_part; + typedef fmt::internal::format_part format_part; typedef format_part::named_argument_id named_argument_id; typedef StrictMock parts_mock; @@ -316,7 +318,7 @@ TEST(PrepareTest, FormatPreparationHandler_OnArgId_AddsPartWithPassedNamedId) { TEST(PrepareTest, FormatPreparationHandler_OnReplacementField_SetsEndOfArgumentId) { - typedef fmt::format_part format_part; + typedef fmt::internal::format_part format_part; typedef StrictMock parts_mock; const auto format = fmt::internal::to_string_view("{:<}"); @@ -338,7 +340,7 @@ TEST(PrepareTest, TEST( PrepareTest, FormatPreparationHandlerLastPartArgIndex_OnFormatSpecs_UpdatesLastAddedPart) { - typedef fmt::format_part format_part; + typedef fmt::internal::format_part format_part; typedef StrictMock parts_mock; parts_mock parts; @@ -369,7 +371,7 @@ TEST( TEST( PrepareTest, FormatPreparationHandlerLastPartNamedArgIndex_OnFormatSpecs_UpdatesLastAddedPart) { - typedef fmt::format_part format_part; + typedef fmt::internal::format_part format_part; typedef StrictMock parts_mock; parts_mock parts; @@ -485,7 +487,7 @@ TEST(PrepareTest, ReusedPreparedFormatType) { } TEST(PrepareTest, UserProvidedPartsContainerUnderlyingContainer) { - typedef fmt::format_part format_part; + typedef fmt::internal::format_part format_part; typedef fmt::internal::parts_container> parts_container; typedef fmt::internal::basic_prepared_format format_part_type; + typedef fmt::internal::format_part format_part_type; private: typedef std::deque parts;