Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Create from usage not working with std::shared_ptr

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
AshMcConnell Posted - Feb 28 2011 : 05:27:38 AM
Hi Folks,

Seems that create from usage doesn't work when using a std::shared_ptr.

e.g.

driver->lastPitSpeedTime = _clock->getTimeMilliseconds();

Where driver is a shared_ptr and lastPitSpeedTime is currently not defined.

It says "refactoring is not available". Also when creating methods it has the same problem: -

driver->setLastPitSpeedTime(_clock->getTimeMilliseconds());

where setLastPitSpeedTime is undefined.


If I have: -

_myLocalMember = _clock->getTimeMilliseconds();

It allows me to create it from usage as a data member (as it's not through a std::shared_ptr)

This is with VS 2010

All the best,
Ash
3   L A T E S T    R E P L I E S    (Newest First)
support Posted - May 12 2011 : 12:50:15 AM
case=55626 is fixed in build 1848
AshMcConnell Posted - Feb 28 2011 : 1:15:55 PM
Yeah, I was previously using boost, but moved to std::shared_ptr. I am using hundreds of shared_ptrs so i'll hopefully wait for a fix if that is possible. Thanks for the tip though :)

All the best,
Ash
feline Posted - Feb 28 2011 : 1:13:01 PM
I am seeing the same effect here. Thank you for the clear description.

case=55626

Create from Usage does understand boost::shared_ptr, at least for me. So you might want to consider this, depending on how often you use shared pointers in your code.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000