mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +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:
@@ -63,7 +63,7 @@ public:
|
||||
|
||||
void push(const value_type& v);
|
||||
void push(value_type&& v);
|
||||
template <class... Args> reference emplace(Args&&... args);
|
||||
template <class... Args> reference emplace(Args&&... args); // reference in C++17
|
||||
void pop();
|
||||
|
||||
void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>)
|
||||
@@ -292,8 +292,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