Revert #456 because it causes issues for known types (#495) and is not C++98-compatible.
This commit is contained in:
Victor Zverovich committed 2017-05-06 08:36:54 -07:00
1 parent 79f11dbaa7
commit dcfd40a1b8
3 files changed
-84

No files matched your search

-8
View File
@@ -277,14 +277,6 @@ typedef __int64 intmax_t;
(FMT_GCC_VERSION >= 303 && FMT_HAS_GXX_CXX11))
#endif
// Checks if decltype v1.1 is supported
// http://en.cppreference.com/w/cpp/compiler_support
#define FMT_HAS_DECLTYPE_INCOMPLETE_RETURN_TYPES \
(FMT_HAS_FEATURE(cxx_decltype_incomplete_return_types) || \
(FMT_GCC_VERSION >= 407 && FMT_HAS_GXX_CXX11) || \
FMT_MSC_VER >= 1900 || \
FMT_ICC_VERSION >= 1200)
#ifdef FMT_HEADER_ONLY
// If header only do not use extern templates.
# undef FMT_USE_EXTERN_TEMPLATES
-34
View File
@@ -68,20 +68,6 @@ struct ConvertToIntImpl<T, true> {
// Write the content of w to os.
FMT_API void write(std::ostream &os, Writer &w);
#if FMT_HAS_DECLTYPE_INCOMPLETE_RETURN_TYPES
template<typename T>
class is_streamable {
template<typename U>
static auto test(int) -> decltype(std::declval<std::ostream &>() << std::declval<U>(), std::true_type());
template<typename>
static auto test(...) -> std::false_type;
public:
static constexpr bool value = decltype(test<T>(0))::value;
};
#endif
} // namespace internal
// Formats a value.
@@ -110,26 +96,6 @@ void format_arg(BasicFormatter<Char, ArgFormatter_> &f,
*/
FMT_API void print(std::ostream &os, CStringRef format_str, ArgList args);
FMT_VARIADIC(void, print, std::ostream &, CStringRef)
#if __cplusplus >= 201103L
template<typename T, typename Char>
typename std::enable_if<
!std::is_same<
typename std::remove_cv<typename std::decay<T>::type>::type,
char *
>::value,
BasicWriter<Char>&
>::type
operator<<(BasicWriter<Char> &writer, const T &value) {
FMT_STATIC_ASSERT(internal::is_streamable<T>::value, "T must be Streamable");
internal::FormatBuf<Char> format_buf(writer.buffer());
std::basic_ostream<Char> output(&format_buf);
output << value;
return writer;
}
#endif
} // namespace fmt
#ifdef FMT_HEADER_ONLY