10 #ifndef LLVM_SUPPORT_FORMATVARIADIC_DETAILS_H 11 #define LLVM_SUPPORT_FORMATVARIADIC_DETAILS_H 16 #include <type_traits> 48 : Item(
std::forward<
T>(Item)) {}
61 using Decayed =
typename std::decay<T>::type;
68 template <
typename U>
static double test(...);
70 static bool const value =
71 (
sizeof(test<llvm::format_provider<Decayed>>(
nullptr)) == 1);
77 using ConstRefT =
const typename std::decay<T>::type &;
80 static char test(
typename std::enable_if<
81 std::is_same<decltype(std::declval<llvm::raw_ostream &>()
82 << std::declval<U>()),
86 template <
typename U>
static double test(...);
88 static bool const value = (
sizeof(test<ConstRefT>(
nullptr)) == 1);
95 :
public std::integral_constant<
97 std::is_base_of<format_adapter,
98 typename std::remove_reference<T>::type>::value> {};
103 template <
typename T>
105 :
public std::integral_constant<
106 bool, !uses_format_member<T>::value && has_FormatProvider<T>::value> {
111 template <
typename T>
113 :
public std::integral_constant<bool, !uses_format_member<T>::value &&
114 !uses_format_provider<T>::value &&
115 has_StreamOperator<T>::value> {};
121 template <
typename T>
123 :
public std::integral_constant<bool, !uses_format_member<T>::value &&
124 !uses_format_provider<T>::value &&
125 !uses_stream_operator<T>::value> {
128 template <
typename T>
129 typename std::enable_if<uses_format_member<T>::value,
T>
::type 131 return std::forward<T>(Item);
134 template <
typename T>
135 typename std::enable_if<uses_format_provider<T>::value,
141 template <
typename T>
142 typename std::enable_if<uses_stream_operator<T>::value,
149 !std::is_same<
llvm::Error,
typename std::remove_cv<T>::type>::value,
150 "llvm::Error-by-value must be wrapped in fmt_consume() for formatv");
154 template <
typename T>
155 typename std::enable_if<uses_missing_provider<T>::value,
Compute iterated dominance frontiers using a linear time algorithm.
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.