Skip to content

Commit 8f56d4a

Browse files
committed
avoid copy from const id reference
This mustn't compile as users got confused about it: ``` Task t; t.id() = "foobar"; ```
1 parent 5944c21 commit 8f56d4a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/include/moveit/task_constructor/task.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class Task : protected WrapperBase
8484
Task& operator=(Task&& other);
8585
~Task();
8686

87-
std::string id() const;
87+
const std::string& id() const;
8888

8989
const moveit::core::RobotModelConstPtr& getRobotModel() const;
9090
/// setting the robot model also resets the task

core/src/task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ void Task::setProperty(const std::string& name, const boost::any& value) {
344344
wrapped()->setProperty(name, value);
345345
}
346346

347-
std::string Task::id() const {
347+
const std::string& Task::id() const {
348348
return pimpl()->id();
349349
}
350350

0 commit comments

Comments
 (0)