You must be registered to post a reply. Click here to register.
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.
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.
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?