4684ddb6aa
- import libcxx - reduce targets to the one when compiled as a tools Change-Id: Iabb8427f80ff8e89463559a28bcb8b4f2bdbc496
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
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.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// <list>
|
|
|
|
// void push_front(value_type&& x);
|
|
|
|
#include <list>
|
|
#include <cassert>
|
|
|
|
#include "../../../MoveOnly.h"
|
|
#include "../../../min_allocator.h"
|
|
|
|
int main()
|
|
{
|
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
{
|
|
std::list<MoveOnly> l1;
|
|
l1.push_front(MoveOnly(1));
|
|
assert(l1.size() == 1);
|
|
assert(l1.front() == MoveOnly(1));
|
|
l1.push_front(MoveOnly(2));
|
|
assert(l1.size() == 2);
|
|
assert(l1.front() == MoveOnly(2));
|
|
assert(l1.back() == MoveOnly(1));
|
|
}
|
|
#if __cplusplus >= 201103L
|
|
{
|
|
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
|
|
l1.push_front(MoveOnly(1));
|
|
assert(l1.size() == 1);
|
|
assert(l1.front() == MoveOnly(1));
|
|
l1.push_front(MoveOnly(2));
|
|
assert(l1.size() == 2);
|
|
assert(l1.front() == MoveOnly(2));
|
|
assert(l1.back() == MoveOnly(1));
|
|
}
|
|
#endif
|
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
}
|