-
June 28th, 2015, 10:49 PM
#1
Returning a boost::shared_ptr from the stack without constructing it?
Assuming the method returns a boost::shared_ptr<AStarPath>,
how do I construct an AStarPath on the return statement without
going through constructing a newPath variable?
Thanks
Jack
Code:
boost::shared_ptr<AStarPath> newPath(new AStarPath(from, transitions, totalCost));
return newPath;
Last edited by lucky6969b; June 28th, 2015 at 11:01 PM.
-
June 29th, 2015, 03:28 AM
#2
Re: Returning a boost::shared_ptr from the stack without constructing it?
Do you mean
Code:
return boost::shared_ptr<AStarPath>(new AStarPath(from, transitions, totalCost));
Last edited by Richard.J; June 29th, 2015 at 03:28 AM.
Reason: fixed code tags
-
June 29th, 2015, 03:29 AM
#3
Re: Returning a boost::shared_ptr from the stack without constructing it?
Yes, thanks, I do mean that...
Jack
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|