Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Add shortcut for shared and unique ptr
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

EugeneKozlov
Senior Member

Russia
39 Posts

Posted - Oct 22 2015 :  1:35:05 PM  Show Profile  Reply with Quote
Hello,

There is a nice shortcut for assingment to pointer:
Class* ptr = [new Class()]
Can you please add same thing for shared_ptr and unique_ptr?

Thank you.

Edited by - EugeneKozlov on Oct 22 2015 3:37:24 PM

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Oct 22 2015 :  5:33:16 PM  Show Profile  Reply with Quote
That makes a lot of sense, I have put in a feature request to see what our developers make of this:

case=92897

zen is the art of being at one with the two'ness
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Dec 16 2015 :  9:02:29 PM  Show Profile  Reply with Quote
case=92897 is implemented in build 2086

By default, VA will suggest two forms of make_shared/make_unique. The suggestions can be configured via the registry DWORD value named "SmartPointerSuggestionStyles".

The value is a bitfield and can be any combination of:
1 --> offers std::make_shared<CFoo>()
2 --> offers std::make_shared<CFoo>(
4 --> offers std::make_shared<CFoo>($end$)

The default value is 3 (1 | 2) -- two suggestions by default.

Each bit value adds a different suggestion to the suggestion list

Given:
std::shared_ptr<CFoo>() pw =

suggestions are:
1 std::make_shared<CFoo>()
2: std::make_shared<CFoo>(
4: std::make_shared<CFoo>($end$)

1 and 3 differ only by caret position after insert (3 leaves caret between the parens, whereas 1 leaves caret at end of inserted text).
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000