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
 Technical Support
 unwanted . to -> conversion for std pointers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

noeldillabough
New Member

Canada
2 Posts

Posted - Oct 21 2017 :  11:20:54 AM  Show Profile  Reply with Quote
similar to the posting std::string unwanted . to -> conversion

when I have a unique_ptr or shared_ptr and hit . it then gets converted to -> and I have to ctrl-z every time...drives me batty!

It happens on many versions of Visual Studio and I've tried the suggestions of recreating the indices etc.

std::unique_ptr<unsigned char> m_data;
m_data.(changes to ->)(ctrl-z changes back to .)get/release/reset etc

std::shared_ptr<unsigned char> m_data;
m_data.(changes to ->)(ctrl-z changes back to .)get

There's quite a few more places where this happens but smart pointers are used constantly. Disabling Visual Assist fixes it.

If it matters I'm currently on VS2017.

Noel Dillabough

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Oct 21 2017 :  2:22:33 PM  Show Profile  Reply with Quote
Can you please try turning off the VA option:

VA Options -> Editor -> Convert dot to -> in C/C++
Convert dot to -> if operator -> is overloaded

and see if this fixes the problem for you? If this setting is turned On, then this behaviour is by design, but if you turn off the setting only for "operator -> is overloaded" the conversion will only stop for smart pointer classes, yet still happen for normal pointers.

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

noeldillabough
New Member

Canada
2 Posts

Posted - Oct 26 2017 :  11:32:26 AM  Show Profile  Reply with Quote
I shut off the feature and it indeed keeps the dot. However for something like this:

A* a;
a.member autocorrects it to a->member correctly.

Good enough for me! Thanks

Noel Dillabough
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