fn: std::vector.pop_back

[contents]

Contents

Syntax

The syntax for std::vector.pop_back calls is:

f++:  
name.pop_back()
std::vector.pop_back(name)

n++:  
@name.pop_back()
@std::vector.pop_back(name)

Description

The std::vector.pop_back function takes a single parameter specifying the name of a standard C++ vector variable, it erases the last element. As a member function it takes zero parameters.

Note: For large scale projects you will find specifying the !mf option to not add member functions during definitions and using std::vector.pop_back is faster than using the pop_back member function.

f++ example

Example of std::vector.pop_back being used with f++:

  1. std::vector<double> v
  2. v.push_back(2.0, 5.3, 3.26)
  3. v.pop_back
  4. std::vector.pop_back(v)
  5. console(v.at(0))

n++ example

Example of std::vector.pop_back being used with n++:

  1. @std::vector<double> v
  2. @v.push_back(2.0, 5.3, 3.26)
  3. @v.pop_back
  4. @std::vector.pop_back(v)
  5. @console(v.at(0))