forked from OSchip/llvm-project
Add a value_type to ArrayRef.
Summary: Not sure this needs a review or not. Erring on the safe side. Reviewers: dblaikie Differential Revision: https://reviews.llvm.org/D41666 llvm-svn: 322538
This commit is contained in:
parent
a6bc5f954c
commit
639a398098
|
@ -45,6 +45,7 @@ namespace llvm {
|
|||
using const_iterator = const T *;
|
||||
using size_type = size_t;
|
||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||
using value_type = typename std::remove_cv<T>::type;
|
||||
|
||||
private:
|
||||
/// The start of the array, in an external buffer.
|
||||
|
|
|
@ -52,6 +52,14 @@ static_assert(
|
|||
"Assigning from an initializer list");
|
||||
#endif
|
||||
|
||||
// Check Typedefs.
|
||||
static_assert(
|
||||
std::is_same<ArrayRef<int>::value_type, int>::value,
|
||||
"erroneous value_type");
|
||||
static_assert(
|
||||
std::is_same<ArrayRef<const int>::value_type, int>::value,
|
||||
"erroneous value_type");
|
||||
|
||||
namespace {
|
||||
|
||||
TEST(ArrayRefTest, AllocatorCopy) {
|
||||
|
|
Loading…
Reference in New Issue