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:
Marshall Clow
2017-01-24 23:09:12 +00:00
parent b4d17ade89
commit 4e42dc97f3
16 changed files with 256 additions and 22 deletions

View File

@@ -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