#ifndef LLVM_SUPPORT_FORMATVARIADICDETAILS_H
#define LLVM_SUPPORT_FORMATVARIADICDETAILS_H
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <type_traits>
namespace llvm {
template <typename T, typename Enable = void> struct format_provider { … };
class Error;
namespace support {
namespace detail {
class format_adapter { … };
template <typename T> class provider_format_adapter : public format_adapter { … };
template <typename T>
class stream_operator_format_adapter : public format_adapter { … };
template <typename T> class missing_format_adapter;
template <class T> class has_FormatProvider { … };
template <class T> class has_StreamOperator { … };
template <typename T>
struct uses_format_member
: public std::integral_constant<
bool, std::is_base_of_v<format_adapter, std::remove_reference_t<T>>> { … };
template <typename T>
struct uses_format_provider
: public std::integral_constant<
bool, !uses_format_member<T>::value && has_FormatProvider<T>::value> { … };
template <typename T>
struct uses_stream_operator
: public std::integral_constant<bool, !uses_format_member<T>::value &&
!uses_format_provider<T>::value &&
has_StreamOperator<T>::value> { … };
template <typename T>
struct uses_missing_provider
: public std::integral_constant<bool, !uses_format_member<T>::value &&
!uses_format_provider<T>::value &&
!uses_stream_operator<T>::value> { … };
template <typename T>
std::enable_if_t<uses_format_member<T>::value, T>
build_format_adapter(T &&Item) { … }
template <typename T>
std::enable_if_t<uses_format_provider<T>::value, provider_format_adapter<T>>
build_format_adapter(T &&Item) { … }
template <typename T>
std::enable_if_t<uses_stream_operator<T>::value,
stream_operator_format_adapter<T>>
build_format_adapter(T &&Item) { … }
template <typename T>
std::enable_if_t<uses_missing_provider<T>::value, missing_format_adapter<T>>
build_format_adapter(T &&) { … }
}
}
}
#endif