4684ddb6aa
- import libcxx - reduce targets to the one when compiled as a tools Change-Id: Iabb8427f80ff8e89463559a28bcb8b4f2bdbc496
35 lines
859 B
C++
35 lines
859 B
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// 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.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// <forward_list>
|
|
|
|
// explicit forward_list(size_type n);
|
|
|
|
#include <forward_list>
|
|
#include <cassert>
|
|
|
|
#include "../../../DefaultOnly.h"
|
|
|
|
int main()
|
|
{
|
|
{
|
|
typedef DefaultOnly T;
|
|
typedef std::forward_list<T> C;
|
|
unsigned N = 10;
|
|
C c = N;
|
|
unsigned n = 0;
|
|
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
|
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
assert(*i == T());
|
|
#else
|
|
;
|
|
#endif
|
|
assert(n == N);
|
|
}
|
|
}
|