本文整理汇总了C++中boost::optional::operator方法的典型用法代码示例。如果您正苦于以下问题:C++ optional::operator方法的具体用法?C++ optional::operator怎么用?C++ optional::operator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::optional
的用法示例。
在下文中一共展示了optional::operator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: end
/// Destination instant of the path
virtual RobotInstant end() const override {
RobotInstant instant = path->end();
if (angleFunction) {
instant.angle = angleFunction->operator()(instant.motion);
return instant;
}
return instant;
}
示例2: evaluate
/**
* This method evaluates the path at a given time and returns the target
* position and velocity of the robot.
*
* @param t Time (in seconds) since the robot started the path. Throws an
* exception if t<0
* @return A MotionInstant containing the position and velocity at the given
* time if @t is within the range of the path. If @t is not within the
* time range of this path, this method returns boost::none.
*/
virtual boost::optional<RobotInstant> evaluate(
RJ::Seconds t) const override {
if (!path) {
return boost::none;
}
boost::optional<RobotInstant> instant = path->evaluate(t);
if (!angleFunction) {
return instant;
} else {
if (instant) {
instant->angle = angleFunction->operator()(instant->motion);
return instant;
} else {
return boost::none;
}
}
}