Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Code Inspection - typedef to using (std::pair)

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
azur Posted - Mar 06 2018 : 04:57:19 AM
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
4   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Mar 06 2018 : 3:57:56 PM
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.
azur Posted - Mar 06 2018 : 09:48:15 AM
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.
azur Posted - Mar 06 2018 : 09:17:13 AM
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

feline Posted - Mar 06 2018 : 08:13:33 AM
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.

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