From 985bd5675a54c7150c89b6357ec01bd2c98884af Mon Sep 17 00:00:00 2001 From: Noemi Erli Date: Tue, 12 Nov 2019 20:08:09 +0200 Subject: [PATCH] Backed out changeset 9b131da7e0cc (bug 1595750) for causing Windows build bustages CLOSED TREE --- xpcom/ds/nsTArray.h | 24 ------------------------ xpcom/tests/gtest/TestTArray.cpp | 11 ----------- 2 files changed, 35 deletions(-) diff --git a/xpcom/ds/nsTArray.h b/xpcom/ds/nsTArray.h index c473df6574ed..4a35ff4a5071 100644 --- a/xpcom/ds/nsTArray.h +++ b/xpcom/ds/nsTArray.h @@ -2730,30 +2730,6 @@ Span MakeSpan( return aTArray; } -template -class nsTArrayBackInserter - : public std::iterator { - nsTArray& mArray; - - public: - explicit nsTArrayBackInserter(nsTArray& aArray) : mArray{aArray} {} - - template - nsTArrayBackInserter& operator=(O&& aValue) { - mArray.EmplaceBack(std::forward(aValue)); - return *this; - } - - nsTArrayBackInserter& operator*() { return *this; } - - void operator++() {} -}; - -template -auto MakeBackInserter(nsTArray& aArray) { - return nsTArrayBackInserter{aArray}; -} - } // namespace mozilla // MOZ_DBG support diff --git a/xpcom/tests/gtest/TestTArray.cpp b/xpcom/tests/gtest/TestTArray.cpp index 8702b1e3237e..7b6d891d28cd 100644 --- a/xpcom/tests/gtest/TestTArray.cpp +++ b/xpcom/tests/gtest/TestTArray.cpp @@ -443,15 +443,4 @@ TEST(TArray, RemoveElementsAt_ByIterator) ASSERT_EQ(expected, array); } -TEST(TArray, MakeBackInserter) -{ - const std::vector src{1, 2, 3, 4}; - nsTArray dst; - - std::copy(src.begin(), src.end(), MakeBackInserter(dst)); - - const nsTArray expected{1, 2, 3, 4}; - ASSERT_EQ(expected, dst); -} - } // namespace TestTArray