diff --git a/CMakeLists.txt b/CMakeLists.txt index 464ac5e7..fe1a6f9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,8 +154,8 @@ function(add_headers VAR) endfunction() # Define the fmt library, its includes and the needed defines. -add_headers(FMT_HEADERS core.h folly.h format.h format-inl.h ostream.h printf.h - time.h ranges.h) +add_headers(FMT_HEADERS core.h format.h format-inl.h ostream.h printf.h time.h + ranges.h) set(FMT_SOURCES src/format.cc) if (HAVE_OPEN) add_headers(FMT_HEADERS posix.h) diff --git a/include/fmt/core.h b/include/fmt/core.h index 14c81ece..8f50b533 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -385,9 +385,7 @@ class basic_buffer { } /** Clears this buffer. */ - void clear() { - size_ = 0; - } + void clear() { size_ = 0; } /** Reserves space to store at least *capacity* elements. */ void reserve(std::size_t new_capacity) { @@ -1356,14 +1354,13 @@ template inline std::basic_string< typename internal::format_string_traits::char_type> format(const String &format_str, const Args & ... args) { - typedef typename internal::format_string_traits::char_type char_type; internal::check_format_string(format_str); // This should be just // return vformat(format_str, make_format_args(args...)); // but gcc has trouble optimizing the latter, so break it down. - typedef typename buffer_context::type context_type; - format_arg_store as{args...}; - return vformat(basic_string_view(format_str), as); + typedef typename internal::format_string_traits::char_type char_t; + format_arg_store::type, Args...> as{args...}; + return vformat(basic_string_view(format_str), as); } FMT_API void vprint(std::FILE *f, string_view format_str, format_args args); diff --git a/include/fmt/folly.h b/include/fmt/folly.h deleted file mode 100644 index b9ffd3e7..00000000 --- a/include/fmt/folly.h +++ /dev/null @@ -1,22 +0,0 @@ -// Formatting library for C++ - folly::StringPiece formatter -// -// Copyright (c) 2012 - present, Victor Zverovich -// All rights reserved. -// -// For the license information refer to format.h. - -#ifndef FMT_FOLLY_H_ -#define FMT_FOLLY_H_ - -#include -#include "core.h" - -FMT_BEGIN_NAMESPACE -template -inline internal::typed_value - make_value(folly::StringPiece s) { - return string_view(s.data(), s.size()); -} -FMT_END_NAMESPACE - -#endif // FMT_FOLLY_H_ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0fcff9f9..1a8c900a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -86,7 +86,6 @@ endfunction() add_fmt_test(assert-test) add_fmt_test(gtest-extra-test) -add_fmt_test(folly-test) add_fmt_test(format-test) add_fmt_test(format-impl-test) add_fmt_test(ostream-test) diff --git a/test/folly-test.cc b/test/folly-test.cc deleted file mode 100644 index c3b1579c..00000000 --- a/test/folly-test.cc +++ /dev/null @@ -1,14 +0,0 @@ -// Formatting library for C++ - folly::StringPiece formatter tests -// -// Copyright (c) 2012 - present, Victor Zverovich -// All rights reserved. -// -// For the license information refer to format.h. - -#include -#include "gtest.h" - -TEST(FollyTest, FormatStringPiece) { - EXPECT_EQ(fmt::format("{}", "foo"), "foo"); - EXPECT_EQ(fmt::format("{:>5}", "foo"), " foo"); -}