Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Curly brackets... again:)

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
bugfix Posted - Jun 26 2006 : 03:38:37 AM
I've already complained a lot about VAX >14xx handles curly brackets.
Currently im writing interface classes w/ default implementation, like:

virtual void blabla()
{
}

Now please tell me how I effciently can achive this format w/o using "undo". This really is annoying!
Maybe VAX can detect return type? Like if it's void no "new line insert + indention" ?

-bugfix
16   L A T E S T    R E P L I E S    (Newest First)
support Posted - Apr 11 2012 : 12:40:37 AM
case=1539 is fixed in build 1903
feline Posted - Jul 04 2006 : 6:25:09 PM
the email arrived, it is just a very busy time at the moment *sigh* so reading emails gets pushed to the back of the queue of jobs.

i have seen templates split between header and cpp file compile on a UNIX server before now, but you had to nurse it along to make that happen. this was some time ago, but we did manage to implement and use the template classes, but i recall sticking all of my template code into the header for ease.

in my time here i have developed a great appreciation of my own ignorance in all sorts of matters templates included. plus it is bad form to tell the customer they don't know what they are talking about

perhaps one day i will discover what Uniwares was up to
bugfix Posted - Jul 02 2006 : 3:14:21 PM
just googled a bit:
http://www.comeaucomputing.com/techtalk/templates/#whylinkerror
bugfix Posted - Jul 02 2006 : 2:53:32 PM
Already tried disabling it... couldn't stand it:) I didn't pay for VAX for no reason, I mean it really aids a lot, it's just that it does a little too much recently.

@feline
Well I know what im talking as well:)
I've sent you an email, not sure if it was filtered out by some spam filter.
feline Posted - Jul 02 2006 : 2:41:40 PM
the template question, the more i did the more puzzled i become by Uniware's statement, but he normally knows what he is talking about. i suspect it is a function of what he is doing, and how he is doing it.

as for compiling vs working, compiling is always a nice first step
support Posted - Jul 02 2006 : 2:22:58 PM
Only a few special characters are permitted in shortcuts for autotext. Opening brace is not one of them. See the paragraph titled, "Shortcut" in:

www.wholetomato.com/products/features/autotext.html?more=yes

As for the original problem of not wanting a blank link, your only workaround at the moment is to disable the "Insert ... " option that drives it and relearn a bit of life prior to VA X. (Ack!)

:)
bugfix Posted - Jul 02 2006 : 09:39:03 AM
It's not that easy... Ok, lets see if I can do a small summary.
Like I said before usually all template code has to be in .h file.
1.)
template<typename X>
class X
{
public:
    void foo()
    {
    }
};
Can be in .h and .cpp b/c member fn in defined in template definition.

2.)
template<typename X>
class X
{
public:
    void foo()
};
template<typename T>
void X<T>::foo() 
{
}
Valid if the complete snippet above is either in .h or .cpp file.
Doesn't work if you move the foo impl to .cpp file and you're using X<>::foo() in another cpp unit. -> linker error.
You'd have to implement X<>::foo() in every .cpp unit you include "x.h".

I have no idea how precompiled headers have impact on this, I don't use em. They tend to cause a lot of problems in like 30+ project solutions.

...and for the record compiling != working:)

-bugfix
feline Posted - Jul 02 2006 : 08:59:51 AM
i have started looking more carefully at C++ templates now, and am pinning down various problems, however most of them are fairly "odd", and may not be things you are encountering. one set of template bugs was reported by Uniwares in this thread:

http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=4817

some of the confusion stemmed from his statement:

quote:
Originally posted by Uniwares

usually its not a problem to have the implementation in the cpp file, at least with vs2005.


i have now worked out why this was working for me. i was editing the template code, but not editing the file that implemented the template, so the template was not being re-generated *oops* sometimes it is the obvious things you overlook.

i can get the template to compile when split across a .h and .cpp file, but only by going #include on the cpp file name, which is basically the same as putting all of the code into the .h file. i wonder if this is what Uniwares has been doing.

create implementation not working well for templates
case=1539
feline Posted - Jun 28 2006 : 4:55:34 PM
this does not surprise me. the only way autotext is really likely to help is if you edit the autotext for Create Implementation, but that does not work so well with templates.
bugfix Posted - Jun 28 2006 : 02:58:41 AM
Just tried to make an autotext entry for "{" w/

{$end$
}

Well, VAX simply ignores it:(
bugfix Posted - Jun 28 2006 : 02:07:33 AM
There are very few cases where template code works or has to be in a cpp file. As a rule of thumb, if it's a template all code belongs in .h file:)
Often compiling of templates works but as soon as you use them you get linker errors. Usually happens if code is in .cpp file.

-bugfix
feline Posted - Jun 27 2006 : 6:18:58 PM
i did not create an instance of the template at the time, i tend to trust Uniwares when he says things, since he writes a lot more template code than i do

i seem to recall having seen a template class split across a .h and a .cpp file compile under UNIX, but it took a bit of doing.

i will put this on my list of things to dig into, and see what i can pin down. currently VS2005 is telling me a function defined in the header is an unresolved external *mutters*

certainly there are some known bugs with VA refactoring and template classes, so more bugs would not surprise me at all.
bugfix Posted - Jun 27 2006 : 02:49:44 AM
quote:
Originally posted by feline

i shall ask support about this question of the blank lines once again.


thx a lot.
quote:

as for the other cases when Create Implementation fails, some of this is new to me. Uniwares has been reporting bugs with template classes, but i did a test, and in VS2005 i had a template class compile successfully when the code was split between the .h and .cpp files, which surprised me.


did you try creating an instance of the template class?
quote:

which IDE are you using?


vs2003
quote:

can you make threads for the cases where you have seen this fail? this way i can try and reproduce, and then make sure there are bug reports for these.


I can when I have some time, I have other things to do as well as doing bugreports all day:) Besides my support ends on 2006.06.29 and I surely won't update until 15xx leaves beta.

-bugfix
feline Posted - Jun 26 2006 : 4:10:58 PM
i shall ask support about this question of the blank lines once again.

as for the other cases when Create Implementation fails, some of this is new to me. Uniwares has been reporting bugs with template classes, but i did a test, and in VS2005 i had a template class compile successfully when the code was split between the .h and .cpp files, which surprised me.

which IDE are you using?

can you make threads for the cases where you have seen this fail? this way i can try and reproduce, and then make sure there are bug reports for these.
bugfix Posted - Jun 26 2006 : 2:26:25 PM
No I don't want to put code inside. At least not in all. Think of it as optionally implementable.

There are a lot of places where "Create Implementation" doesnt work:)
e.g. All code in .h file, functions defined inside a class, templates.
For templates code has to be in .h file and VAX simply moves it to .cpp file, which is another bug:)

Anyways, like I already said in at least 2 threads. VAX should aid a developer not force him to search workarounds:)
IMHO the least common multiple is the old, pre 14xx behaviour. I also doubt that it's hard to put that feature as an option:)

-bugfix
feline Posted - Jun 26 2006 : 2:02:34 PM
*considers*

if you have a default implementation then by definition you have an implementation, so you would want to put some code between the curly brackets? this logic is why simply saying "no body for no return type" does not help, since i often have member functions that do lots of work, but return nothing.

have you considered using Create Implementation to create your empty method bodies? since the formatting of the new method bodies is controlled via an autotext entry you can have as many, or few, blank lines between the curly brackets as you like.

i appreciate that this is irritating, i run into it myself periodically.

case=898

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