diff --git a/src/engine/function.cpp b/src/engine/function.cpp index e9bbef66d..123963f5c 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -309,7 +309,7 @@ struct _stack } // Get reference to the top i-th T item, optionally as a U. I.e. it skips - // the i-th T* items returning it as U&. + // the i-th T items returning it as U&. template remove_cref_t & top(int i = 0) const { @@ -327,7 +327,7 @@ struct _stack // Move "v" to a new slot in ther stack. Returns a reference to the new item. template - remove_cref_t & push( T&& v ); + remove_cref_t & push( T v ); // Copy "v" into "n" new items at the top of the stack. Returns a pointer // to the first, i.e. top most, new item. @@ -443,14 +443,9 @@ void _stack::cleanup_item(_stack * s, int32_t n, LIST**) } template -remove_cref_t & _stack::push( T&& v ) +remove_cref_t & _stack::push( T v ) { - using U = remove_cref_t; - check_alignment(); - data = (char *)data - sizeof(U); - check_alignment(); - cleanup_push( 1 ); - return top() = v; + return *push( v, 1 ); } template