Skip to content

Instantly share code, notes, and snippets.

@vinniefalco
Created August 28, 2020 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinniefalco/b41bd9e0358518a568e03efab6e6daec to your computer and use it in GitHub Desktop.
Save vinniefalco/b41bd9e0358518a568e03efab6e6daec to your computer and use it in GitHub Desktop.
/** Push an object formed by popping `n` key/value pairs from the stack.
This function pushes an @ref object value
onto the stack. The object is formed by first
popping the top `n` key/value pairs from the
stack. If the stack contains fewer than `n`
key/value pairs, or if any of the top `n` key/value
pairs on the stack does not consist of exactly one
key followed by one value, the behavior is undefined.
\n
A key/value pair is formed by pushing a key, and then
pushing a value.
@par Example
The following code creates an object on the stack
with a single element, where key is "x" and value
is true:
@code
value_stack st;
// Place a key/value pair onto the stack
st.push_key( "x" );
st.push_bool( true );
// Replace the key/value pair with an object containing a single element
st.push_object( 1 );
@endcode
@param n The number of key/value pairs to pop from the
top of the stack to form the array.
*/
void
push_object(std::size_t n);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment