mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Add conversion constructor to convert ArrayRef<T*> to ArrayRef<const T*>. Reviewed with Chandler and David Blaikie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216709 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3cd73a5ded
commit
95f7e2d2fd
@ -104,6 +104,14 @@ namespace llvm {
|
||||
Length(Vec.size()) {}
|
||||
#endif
|
||||
|
||||
/// Construct an ArrayRef<const T*> from ArrayRef<T*>. This uses SFINAE to
|
||||
/// ensure that only ArrayRefs of pointers can be converted.
|
||||
template <typename U>
|
||||
ArrayRef(const ArrayRef<U *> &A,
|
||||
typename std::enable_if<
|
||||
std::is_convertible<U *const *, T const *>::value>::type* = 0)
|
||||
: Data(A.data()), Length(A.size()) {}
|
||||
|
||||
/// @}
|
||||
/// @name Simple Operations
|
||||
/// @{
|
||||
|
Loading…
x
Reference in New Issue
Block a user