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
 1522: Refactor "add member" w/ templates
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 11 2006 :  12:02:59 PM  Show Profile  Reply with Quote

template<class C|, typename T>
class VaxTempl{};

-> "Add member" adds member at end of file.


template<typename C|, typename T>
class VaxTempl{};

-> "Add member" is missing in refactor context menu.

-bugfix

http://www.mf-sd.de

rhummer
Tomato Guru

USA
527 Posts

Posted - Jun 11 2006 :  12:21:45 PM  Show Profile  Reply with Quote
good catch, case=1269

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64

Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jun 13 2006 :  2:26:49 PM  Show Profile  Reply with Quote
Will be fixed in build 1523.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jun 14 2006 :  5:16:17 PM  Show Profile  Reply with Quote
Well kinda fixed. If you have a class named "C" or "T" you can use Add Member to add a member to that class and no longer adds the method to the end of the file.

Since in this instance C and T do not really refer to a class, they are place markers for whatever class you may pass in. So, Add Member does not make sense for these symbols. We will disable Add Member in this case in a future build.
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 14 2006 :  6:05:30 PM  Show Profile  Reply with Quote
Why shouldn't it make sense?

template<typename T>
class VaxTempl{T m;};

enum eVax{VAXENUM};

VaxTempl<int> x0;     //ok
VaxTempl<int*> p0;    //ok
VaxTempl<VAXENUM> x1; //ok
VaxTempl< VaxTempl<int> > x2; //ok
VaxTempl<911> x3;     //error
VaxTempl<0.123> x4;     //error

Except for some ints or floats(which aren't allowed anyways) its ok.
IIRC ints can never be used as first template argument.

-bugfix

http://www.mf-sd.de
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Jun 14 2006 :  6:12:43 PM  Show Profile  Reply with Quote
i think what support are saying is this. given the code:

template<typename T> class VaxTempl{ ... };

T is not actually a class. it could be an int, or it could be CString, we do not know until the template is created. so you cannot add a member to the class T, since there is no class T.

which file should the new member be inserted into, when triggered on T?

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

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 14 2006 :  6:14:43 PM  Show Profile  Reply with Quote
T of coz:)

ok.. I've thought "Add Member" would add a member to the template not to T.

http://www.mf-sd.de

Edited by - bugfix on Jun 14 2006 6:19:37 PM
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