mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 01:18:52 +08:00
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:
@@ -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), "");
|
||||
}
|
Reference in New Issue
Block a user