10 #ifndef LLVM_SUPPORT_FORMATVARIADIC_DETAILS_H 11 #define LLVM_SUPPORT_FORMATVARIADIC_DETAILS_H 16 #include <type_traits> 24 virtual void anchor();
50 : Item(
std::forward<
T>(Item)) {}
63 using Decayed =
typename std::decay<T>::type;
70 template <
typename U>
static double test(...);
72 static bool const value =
73 (
sizeof(test<llvm::format_provider<Decayed>>(
nullptr)) == 1);
79 using ConstRefT =
const typename std::decay<T>::type &;
82 static char test(
typename std::enable_if<
83 std::is_same<decltype(std::declval<llvm::raw_ostream &>()
84 << std::declval<U>()),
88 template <
typename U>
static double test(...);
90 static bool const value = (
sizeof(test<ConstRefT>(
nullptr)) == 1);
97 :
public std::integral_constant<
99 std::is_base_of<format_adapter,
100 typename std::remove_reference<T>::type>::value> {};
105 template <
typename T>
107 :
public std::integral_constant<
108 bool, !uses_format_member<T>::value && has_FormatProvider<T>::value> {
113 template <
typename T>
115 :
public std::integral_constant<bool, !uses_format_member<T>::value &&
116 !uses_format_provider<T>::value &&
117 has_StreamOperator<T>::value> {};
123 template <
typename T>
125 :
public std::integral_constant<bool, !uses_format_member<T>::value &&
126 !uses_format_provider<T>::value &&
127 !uses_stream_operator<T>::value> {
130 template <
typename T>
131 typename std::enable_if<uses_format_member<T>::value,
T>
::type 133 return std::forward<T>(Item);
136 template <
typename T>
137 typename std::enable_if<uses_format_provider<T>::value,
143 template <
typename T>
144 typename std::enable_if<uses_stream_operator<T>::value,
151 !std::is_same<
llvm::Error,
typename std::remove_cv<T>::type>::value,
152 "llvm::Error-by-value must be wrapped in fmt_consume() for formatv");
156 template <
typename T>
157 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.