diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-09-05 01:14:30 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-09-05 01:14:30 +0000 |
commit | cbf93f39592428fc01f0c92196c6abf35dc4ed42 (patch) | |
tree | 97d12422d41120001132cdcafc2d442ce0ab86ed /libcxx/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp | |
parent | f9e81f9acbdd07281775fcf8cfcdd2b6a218da19 (diff) | |
download | bcm5719-llvm-cbf93f39592428fc01f0c92196c6abf35dc4ed42.tar.gz bcm5719-llvm-cbf93f39592428fc01f0c92196c6abf35dc4ed42.zip |
sync with N3126
llvm-svn: 113101
Diffstat (limited to 'libcxx/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp')
-rw-r--r-- | libcxx/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libcxx/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp b/libcxx/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp new file mode 100644 index 00000000000..ba0fe08f108 --- /dev/null +++ b/libcxx/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <stack> + +// template <class... Args> void emplace(Args&&... args); + +#include <stack> +#include <cassert> + +#include "../../../../Emplaceable.h" + +int main() +{ +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + std::stack<Emplaceable> q; + q.emplace(1, 2.5); + q.emplace(2, 3.5); + q.emplace(3, 4.5); + assert(q.size() == 3); + assert(q.top() == Emplaceable(3, 4.5)); +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +} |