forked from OSchip/llvm-project
[ADT] Mark `llvm::array_lengthof` as deprecated
As a follow-up of 5e96cea1db
, mark
`llvm::array_lengthof` as deprecated in favor of using `std::size` function
directly.
Differential Revision: https://reviews.llvm.org/D133502
This commit is contained in:
parent
1173ecf9fb
commit
5758c824da
|
@ -18,6 +18,8 @@
|
|||
|
||||
#include <cstddef>
|
||||
|
||||
#include "llvm/Support/Compiler.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -26,7 +28,8 @@ namespace llvm {
|
|||
|
||||
/// Find the length of an array.
|
||||
template <class T, std::size_t N>
|
||||
constexpr inline size_t array_lengthof(T (&)[N]) {
|
||||
constexpr inline LLVM_DEPRECATED("Use std::size instead.", "std::size") size_t
|
||||
array_lengthof(T (&)[N]) {
|
||||
return N;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue