@@ -1742,7 +1742,7 @@ namespace etl
17421742 // / If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
17431743 // *************************************************************************
17441744 template <typename ... Args>
1745- void emplace_back (Args && ... args)
1745+ reference emplace_back (Args && ... args)
17461746 {
17471747#if defined(ETL_CHECK_PUSH_POP)
17481748 ETL_ASSERT (!full (), ETL_ERROR (deque_full));
@@ -1752,6 +1752,7 @@ namespace etl
17521752 ++_end;
17531753 ++current_size;
17541754 ETL_INCREMENT_DEBUG_COUNT
1755+ return back ();
17551756 }
17561757
17571758#else
@@ -1761,7 +1762,7 @@ namespace etl
17611762 // / If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
17621763 // *************************************************************************
17631764 template <typename T1>
1764- void emplace_back (const T1& value1)
1765+ reference emplace_back (const T1& value1)
17651766 {
17661767#if defined(ETL_CHECK_PUSH_POP)
17671768 ETL_ASSERT (!full (), ETL_ERROR (deque_full));
@@ -1771,14 +1772,15 @@ namespace etl
17711772 ++_end;
17721773 ++current_size;
17731774 ETL_INCREMENT_DEBUG_COUNT
1775+ return back ();
17741776 }
17751777
17761778 // *************************************************************************
17771779 // / Emplaces an item to the back of the deque.
17781780 // / If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
17791781 // *************************************************************************
17801782 template <typename T1, typename T2>
1781- void emplace_back (const T1& value1, const T2& value2)
1783+ reference emplace_back (const T1& value1, const T2& value2)
17821784 {
17831785#if defined(ETL_CHECK_PUSH_POP)
17841786 ETL_ASSERT (!full (), ETL_ERROR (deque_full));
@@ -1788,14 +1790,15 @@ namespace etl
17881790 ++_end;
17891791 ++current_size;
17901792 ETL_INCREMENT_DEBUG_COUNT
1793+ return back ();
17911794 }
17921795
17931796 // *************************************************************************
17941797 // / Emplaces an item to the back of the deque.
17951798 // / If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
17961799 // *************************************************************************
17971800 template <typename T1, typename T2, typename T3>
1798- void emplace_back (const T1& value1, const T2& value2, const T3& value3)
1801+ reference emplace_back (const T1& value1, const T2& value2, const T3& value3)
17991802 {
18001803#if defined(ETL_CHECK_PUSH_POP)
18011804 ETL_ASSERT (!full (), ETL_ERROR (deque_full));
@@ -1805,14 +1808,15 @@ namespace etl
18051808 ++_end;
18061809 ++current_size;
18071810 ETL_INCREMENT_DEBUG_COUNT
1811+ return back ();
18081812 }
18091813
18101814 // *************************************************************************
18111815 // / Emplaces an item to the back of the deque.
18121816 // / If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
18131817 // *************************************************************************
18141818 template <typename T1, typename T2, typename T3, typename T4>
1815- void emplace_back (const T1& value1, const T2& value2, const T3& value3, const T4& value4)
1819+ reference emplace_back (const T1& value1, const T2& value2, const T3& value3, const T4& value4)
18161820 {
18171821#if defined(ETL_CHECK_PUSH_POP)
18181822 ETL_ASSERT (!full (), ETL_ERROR (deque_full));
@@ -1822,6 +1826,7 @@ namespace etl
18221826 ++_end;
18231827 ++current_size;
18241828 ETL_INCREMENT_DEBUG_COUNT
1829+ return back ();
18251830 }
18261831#endif
18271832
@@ -1870,7 +1875,7 @@ namespace etl
18701875 // / If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
18711876 // *************************************************************************
18721877 template <typename ... Args>
1873- void emplace_front (Args && ... args)
1878+ reference emplace_front (Args && ... args)
18741879 {
18751880#if defined(ETL_CHECK_PUSH_POP)
18761881 ETL_ASSERT (!full (), ETL_ERROR (deque_full));
@@ -1880,6 +1885,7 @@ namespace etl
18801885 ::new (&(*_begin)) T (etl::forward<Args>(args)...);
18811886 ++current_size;
18821887 ETL_INCREMENT_DEBUG_COUNT
1888+ return front ();
18831889 }
18841890
18851891#else
@@ -1889,7 +1895,7 @@ namespace etl
18891895 // / If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
18901896 // *************************************************************************
18911897 template <typename T1>
1892- void emplace_front (const T1& value1)
1898+ reference emplace_front (const T1& value1)
18931899 {
18941900#if defined(ETL_CHECK_PUSH_POP)
18951901 ETL_ASSERT (!full (), ETL_ERROR (deque_full));
@@ -1899,14 +1905,15 @@ namespace etl
18991905 ::new (&(*_begin)) T (value1);
19001906 ++current_size;
19011907 ETL_INCREMENT_DEBUG_COUNT
1908+ return front ();
19021909 }
19031910
19041911 // *************************************************************************
19051912 // / Emplaces an item to the front of the deque.
19061913 // / If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
19071914 // *************************************************************************
19081915 template <typename T1, typename T2>
1909- void emplace_front (const T1& value1, const T2& value2)
1916+ reference emplace_front (const T1& value1, const T2& value2)
19101917 {
19111918#if defined(ETL_CHECK_PUSH_POP)
19121919 ETL_ASSERT (!full (), ETL_ERROR (deque_full));
@@ -1916,14 +1923,15 @@ namespace etl
19161923 ::new (&(*_begin)) T (value1, value2);
19171924 ++current_size;
19181925 ETL_INCREMENT_DEBUG_COUNT
1926+ return front ();
19191927 }
19201928
19211929 // *************************************************************************
19221930 // / Emplaces an item to the front of the deque.
19231931 // / If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
19241932 // *************************************************************************
19251933 template <typename T1, typename T2, typename T3>
1926- void emplace_front (const T1& value1, const T2& value2, const T3& value3)
1934+ reference emplace_front (const T1& value1, const T2& value2, const T3& value3)
19271935 {
19281936#if defined(ETL_CHECK_PUSH_POP)
19291937 ETL_ASSERT (!full (), ETL_ERROR (deque_full));
@@ -1933,14 +1941,15 @@ namespace etl
19331941 ::new (&(*_begin)) T (value1, value2, value3);
19341942 ++current_size;
19351943 ETL_INCREMENT_DEBUG_COUNT
1944+ return front ();
19361945 }
19371946
19381947 // *************************************************************************
19391948 // / Emplaces an item to the front of the deque.
19401949 // / If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
19411950 // *************************************************************************
19421951 template <typename T1, typename T2, typename T3, typename T4>
1943- void emplace_front (const T1& value1, const T2& value2, const T3& value3, const T4& value4)
1952+ reference emplace_front (const T1& value1, const T2& value2, const T3& value3, const T4& value4)
19441953 {
19451954#if defined(ETL_CHECK_PUSH_POP)
19461955 ETL_ASSERT (!full (), ETL_ERROR (deque_full));
@@ -1950,6 +1959,7 @@ namespace etl
19501959 ::new (&(*_begin)) T (value1, value2, value3, value4);
19511960 ++current_size;
19521961 ETL_INCREMENT_DEBUG_COUNT
1962+ return front ();
19531963 }
19541964#endif
19551965
0 commit comments