本文整理汇总了C++中parameters::pop_back方法的典型用法代码示例。如果您正苦于以下问题:C++ parameters::pop_back方法的具体用法?C++ parameters::pop_back怎么用?C++ parameters::pop_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parameters
的用法示例。
在下文中一共展示了parameters::pop_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make_polygon
object_ptr interpreter::make_polygon (parameters &command) {
TRACE ('f', command);
double thick = 2.0; //Default thickness of 2
if (command.size() % 2 == 1){
thick = from_string<double>(command.back());
command.pop_back();
}
coordlist poly_points{};
while(!command.empty()){
double x = from_string<double>(shift(command));
double y = from_string<double>(shift(command));
poly_points.push_back({inches(x), inches(y)});
}
return make_shared<polygon> (poly_points, points(thick));
}
示例2: do_draw
void interpreter::do_draw (parameters ¶ms) {
TRACE ('i', params);
string name = shift (params);
object_map::const_iterator itor = objmap.find (name);
if (itor == objmap.end()) {
throw runtime_error (name + ": no such object");
}
degrees angle = degrees (0);
if (params.size() == 3) {
angle = degrees (from_string<double> (params.back()));
params.pop_back();
}
if (params.size() != 2) throw runtime_error ("syntax error");
xycoords coords (inches (from_string<double> (params.front())),
inches (from_string<double> (params.back())));
itor->second->draw (outfile, coords, angle);
}