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
 Create impl for template methods/functions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

andre.horst
Tomato Guru

Germany
150 Posts

Posted - Sep 04 2008 :  04:24:51 AM  Show Profile  Reply with Quote
It would be nice if VAX were able to create a specialized implementation for a template method or function. F.e.


template< class T > void F( T p )
{
    T foo ;
}

After "Create Implementation" from the refactor men++ i choose or write down the type for T and get the special implementation for it. Note that should also work for more than one template argument. A bit difficult to handle could be default template arguments. Especially more than one template argument could be interesting to refactor, if all combinations for the given type-replacements will be generated automatically.

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Sep 04 2008 :  08:05:08 AM  Show Profile  Reply with Quote
I do not understand what you want. The compiler creates an instance of a template class / function its self. This is what templates are for.

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

andre.horst
Tomato Guru

Germany
150 Posts

Posted - Sep 04 2008 :  08:17:36 AM  Show Profile  Reply with Quote
Yes, thats right. But for some circumstances it is better to have the implementation for a specific type (special and optimized handling/programming for that type) and to avoid inlining all the time. Thus the code gets smaller if you have a call to a specialized complex template method instead of the whole code be inlined again and again and faster if you can optimize for a specific type.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Sep 10 2008 :  09:56:49 AM  Show Profile  Reply with Quote
Have you considered using the IDE's Find and Replace feature? Just copy the template and then use Find and Replace to replace "T" with the type. Turn on whole word and case matching and this should do what you want.

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

andre.horst
Tomato Guru

Germany
150 Posts

Posted - Sep 16 2008 :  05:54:06 AM  Show Profile  Reply with Quote
Ok. This works, but that isnt that mighty as i wanted it. But i understand that the use-case isnt reuired very often. Btw: renaming of template arguments is still a missing feature.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Sep 16 2008 :  08:09:56 AM  Show Profile  Reply with Quote
You can run Rename on a template argument, but VA finds to many references. This is a known problem and is on our list of things to fix:

case=16397

zen is the art of being at one with the two'ness
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