[build] Upgrade clang-format and clang-tidy (NFC) (#3422)

This commit is contained in:
Tyler Veness
2021-06-10 11:13:09 -07:00
committed by GitHub
parent 099fde97d5
commit a77c6ff3a2
29 changed files with 66 additions and 48 deletions

View File

@@ -37,19 +37,20 @@ class function_ref<Ret(Params...)> {
template <typename Callable>
static Ret callback_fn(intptr_t callable, Params... params) {
return (*reinterpret_cast<Callable*>(callable))(
std::forward<Params>(params)...);
return (*reinterpret_cast<Callable*>(callable))(std::forward<Params>(
params)...);
}
public:
function_ref() = default;
function_ref(std::nullptr_t) {}
/*implicit*/ function_ref(std::nullptr_t) {} // NOLINT
template <typename Callable>
function_ref(Callable&& callable,
typename std::enable_if<
!std::is_same<typename std::remove_reference<Callable>::type,
function_ref>::value>::type* = nullptr)
/*implicit*/ function_ref( // NOLINT
Callable&& callable,
typename std::enable_if<
!std::is_same<typename std::remove_reference<Callable>::type,
function_ref>::value>::type* = nullptr)
: callback(callback_fn<typename std::remove_reference<Callable>::type>),
callable(reinterpret_cast<intptr_t>(&callable)) {}