Another test for LWG2952

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318126 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2017-11-14 01:18:36 +00:00
parent 52728778fa
commit 8437dbd021

View File

@@ -0,0 +1,28 @@
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <iterator>
// template<class T>
// struct iterator_traits<const T*>
#include <iterator>
#include <type_traits>
struct A {};
int main()
{
typedef std::iterator_traits<const volatile A*> It;
static_assert((std::is_same<It::difference_type, std::ptrdiff_t>::value), "");
static_assert((std::is_same<It::value_type, A>::value), "");
static_assert((std::is_same<It::pointer, const volatile A*>::value), "");
static_assert((std::is_same<It::reference, const volatile A&>::value), "");
static_assert((std::is_same<It::iterator_category, std::random_access_iterator_tag>::value), "");
}