Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Support namespaced c++ enums

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
oysteinkrag Posted - Sep 12 2013 : 04:41:06 AM
I find it handy to put enums in namespaces, so that I don't get naming conflicts between different enums.
It seems like VisualAssist X does not support this scheme.
When I do "Create from usage" or just select an enum from the suggestion list, Visual Assist does not prepend the name space for me.

Possible to fix in next version?
5   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Oct 04 2013 : 6:08:40 PM
I have lost in the details but Sean is right. You can learn more about VA snippets here:
http://www.wholetomato.com/products/features/vasnippets.asp
sean Posted - Oct 03 2013 : 8:11:52 PM
I like that pattern. You could create a snippet for the namespace and enum having VA prompt you in this example for Color and Value.

Something like:
namespace $Namespace$ { enum $Enum$
{
$end$
} }
accord Posted - Oct 03 2013 : 7:16:14 PM
What do you mean by "VA suggested to create enums"? Can you please give me an example from what VA could create an enum?
Alek86 Posted - Oct 03 2013 : 10:40:56 AM
In C++03 I love to create enums this way:



namespace Color { enum Value
{
 Red,
 Green,
 Blue
}}

// using

Color::Value color = Color::Red;

int Function(Color::Value d);



it would be perfect if VA suggested to create enums in this way also.
accord Posted - Sep 14 2013 : 1:19:39 PM
Good idea. But
1. Do you think that the "suggestion should put namespace as well" idea should also be applied to other symbols (e.g. variables and function)?
2. You said that "I find it handy to put enums in namespaces, so that I don't get naming conflicts between different enums."
What about Visual Assist? You may have a variable in 2 namespaces simultaneously. I mean, two different one, with the same name
What do you think?
If say VA would provide a second listbox to select a namespace it would be kind of "obstructive" in a way.

One idea is to list the symbol name twice for both namespaces, with a name like
NamespaceOne::Symbol1
NamespaceTwo::Symbol1

But you can still have a loads of stuff with simple names like Update() for a methods or ENABLE for an enum item.

Regarding Create from usage, can you give me an example?

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