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
 Code Inspection - typedef to using (std::pair)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

azur
Ketchup Master

Germany
52 Posts

Posted - Mar 06 2018 :  04:57:19 AM  Show Profile  Reply with Quote
This is my code:
typedef struct pair<PBYTE, unsigned char> PAIR_PBYTE_N;

After converting to 'using' decleration. I got
error C2906: 'std::pair<PBYTE,unsigned char>': explicit specialization requires 'template <>'


How can I prevent Visual Assist to detect that the code (possible) can be converted? Can I set a hint for VA only on this line like?:
typedef struct pair<PBYTE, unsigned char> PAIR_PBYTE_N; //VA.CodeInspection.Disabled

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Mar 06 2018 :  08:13:33 AM  Show Profile  Reply with Quote
I am seeing the same problem here, thank you for the clear description. It looks like std::pair is something of a special case, so I have put in a bug report suggesting that we don't suggest this code inspection for std::pair types:

case=114884

For now, if you turn Off

VA Options -> Code Inspection (beta) -> Typedef can be converted to 'using' declaration

then no typedef corrections will be suggested. A bit broader, but hopefully helpful.

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

azur
Ketchup Master

Germany
52 Posts

Posted - Mar 06 2018 :  09:17:13 AM  Show Profile  Reply with Quote
I find the VA suggestions "convert typedef to using" very helpfully. So I have to live with that until you release a fix. That's not a big problem.

Thank you for working on this issue, Axel

Go to Top of Page

azur
Ketchup Master

Germany
52 Posts

Posted - Mar 06 2018 :  09:48:15 AM  Show Profile  Reply with Quote
I found a solution for the issue.
typedef struct pair<int, int> PAIR_N_N;
is equitable
typedef pair<int, int> PAIR_N_N;
Then the converted
using PAIR_N_N = pair<int, int>;
works fine. I think that
typedef struct pair ...
was necessary with older compilers. So it woud be nice if VA can fix this during conversion.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Mar 06 2018 :  3:57:56 PM  Show Profile  Reply with Quote
That's interesting, thank you for the update, and this makes more sense of why the code is having problems. Out of interest I checked a couple of different versions of the IDE, and the typedef without "struct" compiles quite happily in VS2008, so it looks like this is the better part to focus on.

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