mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00
Cleanup one more <forward_list> test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300417 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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);
|
||||
}
|
||||
}
|
@@ -36,6 +36,11 @@ void check_allocator(unsigned n, Allocator const &alloc = Allocator())
|
||||
|
||||
int main()
|
||||
{
|
||||
{ // test that the ctor is explicit
|
||||
typedef std::forward_list<DefaultOnly> C;
|
||||
static_assert((std::is_constructible<C, size_t>::value), "");
|
||||
static_assert((!std::is_convertible<size_t, C>::value), "");
|
||||
}
|
||||
{
|
||||
typedef DefaultOnly T;
|
||||
typedef std::forward_list<T> C;
|
||||
|
Reference in New Issue
Block a user