mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 10:07:41 +08:00
Change the return type of emplace_[front|back] back to void when building with C++14 or before. Resolves PR31680.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292990 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -55,7 +55,7 @@ public:
|
||||
|
||||
void push(const value_type& x);
|
||||
void push(value_type&& x);
|
||||
template <class... Args> reference emplace(Args&&... args);
|
||||
template <class... Args> reference emplace(Args&&... args); // reference in C++17
|
||||
void pop();
|
||||
|
||||
void swap(stack& c) noexcept(is_nothrow_swappable_v<Container>)
|
||||
@@ -199,8 +199,13 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
reference emplace(_Args&&... __args)
|
||||
{ return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
|
||||
#else
|
||||
void emplace(_Args&&... __args)
|
||||
{ c.emplace_back(_VSTD::forward<_Args>(__args)...);}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
||||
Reference in New Issue
Block a user