Conditionally compile C++11 parts.

This commit is contained in:
Victor Zverovich 2013-12-09 08:12:33 -08:00
parent 185ec1d91e
commit bd5fe67eef

View File

@ -36,13 +36,16 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <algorithm> #include <algorithm>
#include <initializer_list>
#include <iterator> #include <iterator>
#include <limits> #include <limits>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <sstream> #include <sstream>
#if FMT_USE_CXX11
# include <initializer_list>
#endif
// Compatibility with compilers other than clang. // Compatibility with compilers other than clang.
#ifndef __has_feature #ifndef __has_feature
# define __has_feature(x) 0 # define __has_feature(x) 0
@ -996,6 +999,7 @@ class BasicFormatter {
BasicFormatter(BasicWriter<Char> &w, const Char *format = 0) BasicFormatter(BasicWriter<Char> &w, const Char *format = 0)
: writer_(&w), format_(format) {} : writer_(&w), format_(format) {}
#if FMT_USE_CXX11
// Constructs a formatter with formatting arguments. // Constructs a formatter with formatting arguments.
BasicFormatter(BasicWriter<Char> &w, BasicFormatter(BasicWriter<Char> &w,
const Char *format, std::initializer_list<Arg> args) const Char *format, std::initializer_list<Arg> args)
@ -1004,6 +1008,7 @@ class BasicFormatter {
for (const Arg &arg: args) for (const Arg &arg: args)
args_.push_back(&arg); args_.push_back(&arg);
} }
#endif
// Performs formatting if the format string is non-null. The format string // Performs formatting if the format string is non-null. The format string
// can be null if its ownership has been transferred to another formatter. // can be null if its ownership has been transferred to another formatter.