-
-
Notifications
You must be signed in to change notification settings - Fork 245
/
InsightsUtility.h
36 lines (28 loc) · 1.69 KB
/
InsightsUtility.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/******************************************************************************
*
* C++ Insights, copyright (C) by Andreas Fertig
* Distributed under an MIT license. See LICENSE for details
*
****************************************************************************/
#ifndef INSIGHTS_UTILITY_H
#define INSIGHTS_UTILITY_H
#include "llvm/ADT/STLExtras.h"
#include <type_traits>
#include <utility>
//-----------------------------------------------------------------------------
///! A helper inspired by https://github.com/Microsoft/wil/wiki/Error-handling-helpers
#define RETURN_IF(cond) \
if(cond) { \
return; \
}
//-----------------------------------------------------------------------------
#define RETURN_FALSE_IF(cond) \
if(cond) { \
return false; \
}
//-----------------------------------------------------------------------------
using void_func_ref = llvm::function_ref<void()>;
//-----------------------------------------------------------------------------
template<typename T, typename... Ts>
concept same_as_any_of = (std::same_as<T, Ts> or ...);
#endif /* INSIGHTS_UTILITY_H */