diff options
Diffstat (limited to 'test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp')
-rw-r--r-- | test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp new file mode 100644 index 000000000000..ef3dc5d10796 --- /dev/null +++ b/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp @@ -0,0 +1,43 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// vector& operator=(initializer_list<value_type> il); + +#include <vector> +#include <cassert> + +#include "min_allocator.h" + +int main() +{ +#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + { + std::vector<bool> d; + d = {true, false, false, true}; + assert(d.size() == 4); + assert(d[0] == true); + assert(d[1] == false); + assert(d[2] == false); + assert(d[3] == true); + } +#if __cplusplus >= 201103L + { + std::vector<bool, min_allocator<bool>> d; + d = {true, false, false, true}; + assert(d.size() == 4); + assert(d[0] == true); + assert(d[1] == false); + assert(d[2] == false); + assert(d[3] == true); + } +#endif +#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +} |