mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318244 91177308-0d34-0410-b5e6-96231b3b80d8
47 lines
986 B
C++
47 lines
986 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.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// <vector>
|
|
|
|
// class vector
|
|
|
|
// bool empty() const noexcept;
|
|
|
|
#include <vector>
|
|
#include <cassert>
|
|
|
|
#include "test_macros.h"
|
|
#include "min_allocator.h"
|
|
|
|
int main()
|
|
{
|
|
{
|
|
typedef std::vector<int> C;
|
|
C c;
|
|
ASSERT_NOEXCEPT(c.empty());
|
|
assert(c.empty());
|
|
c.push_back(C::value_type(1));
|
|
assert(!c.empty());
|
|
c.clear();
|
|
assert(c.empty());
|
|
}
|
|
#if TEST_STD_VER >= 11
|
|
{
|
|
typedef std::vector<int, min_allocator<int>> C;
|
|
C c;
|
|
ASSERT_NOEXCEPT(c.empty());
|
|
assert(c.empty());
|
|
c.push_back(C::value_type(1));
|
|
assert(!c.empty());
|
|
c.clear();
|
|
assert(c.empty());
|
|
}
|
|
#endif
|
|
}
|