9 #ifndef LLVM_SUPPORT_FORMATVARIADIC_DETAILS_H 10 #define LLVM_SUPPORT_FORMATVARIADIC_DETAILS_H 15 #include <type_traits> 23 virtual void anchor();
49 : Item(
std::forward<
T>(Item)) {}
62 using Decayed =
typename std::decay<T>::type;
69 template <
typename U>
static double test(...);
71 static bool const value =
72 (
sizeof(test<llvm::format_provider<Decayed>>(
nullptr)) == 1);
78 using ConstRefT =
const typename std::decay<T>::type &;
81 static char test(
typename std::enable_if<
82 std::is_same<decltype(std::declval<llvm::raw_ostream &>()
83 << std::declval<U>()),
87 template <
typename U>
static double test(...);
89 static bool const value = (
sizeof(test<ConstRefT>(
nullptr)) == 1);
96 :
public std::integral_constant<
98 std::is_base_of<format_adapter,
99 typename std::remove_reference<T>::type>::value> {};
104 template <
typename T>
106 :
public std::integral_constant<
107 bool, !uses_format_member<T>::value && has_FormatProvider<T>::value> {
112 template <
typename T>
114 :
public std::integral_constant<bool, !uses_format_member<T>::value &&
115 !uses_format_provider<T>::value &&
116 has_StreamOperator<T>::value> {};
122 template <
typename T>
124 :
public std::integral_constant<bool, !uses_format_member<T>::value &&
125 !uses_format_provider<T>::value &&
126 !uses_stream_operator<T>::value> {
129 template <
typename T>
130 typename std::enable_if<uses_format_member<T>::value,
T>
::type 132 return std::forward<T>(Item);
135 template <
typename T>
136 typename std::enable_if<uses_format_provider<T>::value,
142 template <
typename T>
143 typename std::enable_if<uses_stream_operator<T>::value,
150 !std::is_same<
llvm::Error,
typename std::remove_cv<T>::type>::value,
151 "llvm::Error-by-value must be wrapped in fmt_consume() for formatv");
155 template <
typename T>
156 typename std::enable_if<uses_missing_provider<T>::value,
This class represents lattice values for constants.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
std::enable_if< uses_missing_provider< T >::value, missing_format_adapter< T > >::type build_format_adapter(T &&Item)
const typename std::decay< T >::type & ConstRefT
Lightweight error class with error context and mandatory checking.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.