Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Suggestion for type on cast instruction

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
xMRi Posted - Jul 06 2007 : 02:48:08 AM
Is it possible to give a suggesstion for the type of a cast when typing instructions like this:

CMyClass *pMyClass = reinterpret_cast<

At this point it is possible to give a suggestion of the type of the cast.

It is true that the statement might do something different like this
CMyClass *pMyClass = reinterpret_cast<PTR_OTHER>(x)->GetMyClass();

But in most cases it looks like this
CMyClass *pMyClass = reinterpret_cast<CMyClass *>(lParam);
2   L A T E S T    R E P L I E S    (Newest First)
kevinsikes Posted - Jul 06 2007 : 05:53:04 AM
By the way, there is an existing method for constructing cast statements using Autotext. Open the Autotext editor and locate a C++ shortcut named dyna for an example, or simply type dyna in the text editor and accept the suggestion.
kevinsikes Posted - Jul 06 2007 : 04:05:46 AM
Martin,

This is an excellent suggestion. I'd go even further to say that casting operators should always appear in suggestion lists (currently it's hit or miss), and that they should autocomplete with the angle brackets and parentheses. Ideally, type this code:
Foo* pFoo = static_c
and be given this suggestion:
static_cast<Foo*>()
with the caret positioned inside the parentheses

I've also requested the same logic when casting to an expected parameter type:

void MyFunction(Foo* pFoo){}

Void Bar()
{
    MyFunction(dynamic_c   // at this point, offer suggestion dynamic_cast<Foo*>()
}

case=7519

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