mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
Add LLVM_HAS_INITIALIZER_LISTS for upcoming C++11 support. Use it in ArrayRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194362 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -83,6 +83,13 @@ namespace llvm {
|
||||
/*implicit*/ LLVM_CONSTEXPR ArrayRef(const T (&Arr)[N])
|
||||
: Data(Arr), Length(N) {}
|
||||
|
||||
#if LLVM_HAS_INITIALIZER_LISTS
|
||||
/// Construct an ArrayRef from a std::initializer_list.
|
||||
/*implicit*/ ArrayRef(const std::initializer_list<T> &Vec)
|
||||
: Data(Vec.begin() == Vec.end() ? (T*)0 : Vec.begin()),
|
||||
Length(Vec.size()) {}
|
||||
#endif
|
||||
|
||||
/// @}
|
||||
/// @name Simple Operations
|
||||
/// @{
|
||||
|
||||
Reference in New Issue
Block a user