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
 Suggestion for type on cast instruction
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

xMRi
Tomato Guru

Germany
315 Posts

Posted - Jul 06 2007 :  02:48:08 AM  Show Profile  Reply with Quote
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);

Martin Richter [rMVP] WWJD http://blog.m-ri.de
"A well-written program is its own heaven; a poorly written
program is its own hell!" The Tao of Programming

kevinsikes
Tomato Guru

USA
271 Posts

Posted - Jul 06 2007 :  04:05:46 AM  Show Profile  Reply with Quote
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

Kevin Sikes
Infotainment Platform Design Engineer
Ford Motor Company
Go to Top of Page

kevinsikes
Tomato Guru

USA
271 Posts

Posted - Jul 06 2007 :  05:53:04 AM  Show Profile  Reply with Quote
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.

Kevin Sikes
Infotainment Platform Design Engineer
Ford Motor Company

Edited by - kevinsikes on Jul 06 2007 06:05:54 AM
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