[support.initlist.range]

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@104975 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2010-05-28 17:53:59 +00:00
parent a309da151c
commit fcc593875c
2 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <initializer_list>
// template<class E> const E* begin(initializer_list<E> il);
#include <initializer_list>
#include <cassert>
struct A
{
A(std::initializer_list<int> il)
{
const int* b = begin(il);
const int* e = end(il);
assert(il.size() == 3);
assert(e - b == il.size());
assert(*b++ == 3);
assert(*b++ == 2);
assert(*b++ == 1);
}
};
int main()
{
#ifdef _LIBCPP_MOVE
A test1 = {3, 2, 1};
#endif
}