Corrections according to feedback

This commit is contained in:
Glen Stark 2016-06-09 13:25:35 +02:00
parent 60b8b0bca4
commit c188cfe298
4 changed files with 3 additions and 29 deletions

View File

@ -26,7 +26,7 @@
*/
#include "fmt/format.h"
#include "printf.h"
#include "fmt/printf.h"
#include <string.h>
@ -38,8 +38,6 @@
namespace fmt {
namespace internal {
// This method is used to preserve binary compatibility with fmt 3.0.
@ -313,10 +311,6 @@ FMT_FUNC void fmt::print_colored(Color c, CStringRef format, ArgList args) {
}
#ifndef FMT_HEADER_ONLY
template struct fmt::internal::BasicData<void>;
@ -327,7 +321,6 @@ template void fmt::internal::FixedBuffer<char>::grow(std::size_t);
template void fmt::internal::ArgMap<char>::init(const fmt::ArgList &args);
template int fmt::internal::CharTraits<char>::format_float(
char *buffer, std::size_t size, const char *format,
unsigned width, int precision, double value);
@ -342,7 +335,6 @@ template void fmt::internal::FixedBuffer<wchar_t>::grow(std::size_t);
template void fmt::internal::ArgMap<wchar_t>::init(const fmt::ArgList &args);
template int fmt::internal::CharTraits<wchar_t>::format_float(
wchar_t *buffer, std::size_t size, const wchar_t *format,
unsigned width, int precision, double value);

View File

@ -1987,7 +1987,7 @@ class FormatterBase {
*/
template <typename Impl, typename Char>
class BasicArgFormatter : public internal::ArgFormatterBase<Impl, Char> {
private:
private:
BasicFormatter<Char, Impl> &formatter_;
const Char *format_;

View File

@ -33,7 +33,7 @@
#include <climits>
#include <cerrno>
#include <cstdarg>//< Only for windows?
#include <cstdarg>
#if defined(_WIN32) && defined(__MINGW32__)
@ -81,12 +81,6 @@ static inline fmt::internal::Null<> strerror_s(char *, std::size_t, ...) {
namespace fmt {
namespace internal {
// template <typename Char> class DefaultPrintfArgFormatter;
// template <typename CharT,
// typename PFAF = fmt::internal::DefaultPrintfArgFormatter<CharT> >
// class PrintfFormatter;
template <typename Impl, typename CharT>
class PrintfArgFormatter : public internal::ArgFormatterBase<Impl, CharT> {

View File

@ -29,9 +29,6 @@
#include "fmt/printf.h"
#include "gtest-extra.h"
#include <iostream>
// A custom argument formatter that doesn't print `-` for floating-point values
// rounded to 0.
class CustomArgFormatter :
@ -83,15 +80,6 @@ std::string printfer(const char* fstr, fmt::ArgList args){
FMT_VARIADIC(std::string, printfer, const char*);
// Makes format string argument positional.
std::string make_positional(fmt::StringRef format) {
std::string s(format.to_string());
s.replace(s.find('%'), 1, "%1$");
return s;
}
TEST(custom, foo){
EXPECT_EQ("0.00", custom_format("{:.2f}", -.00001));
EXPECT_EQ("0.00", printfer("%.2f", -.00001));