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
 1649: create implementation template miscues
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Frunobulax
Ketchup Master

84 Posts

Posted - Sep 16 2008 :  11:27:44 AM  Show Profile  Reply with Quote
Hi,

a few things that go wrong when calling create implementation with template parameters.

First is the case of a template function in a non-template class:

class foo {
    template <class T>
    void function1(T parameter);
};

// generated implementation
template <class T>
void foo<T>::function1( T parameter )
{

}


The generated code is wrong, this should be "foo::function1" instead of "foo<T>::function1".

Next problem is in case of a specialization:


class bar;
template<>
class foo<bar> {
    void function1(T parameter);
};

// generated implementation
template<>
void foo<bar><>::function1( T parameter )
{

}


The correct implementation would be

void foo<bar>::function1( T parameter );


and can/should be located in the .cpp file.

Regards, Thomas

"The nice part about being a pessimist
is that you are constantly being either
proven right or pleasantly surprised."
(George F. Will)

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 16 2008 :  2:48:39 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

The first problem is

case=5476

I have put in a bug report for specialized template class member functions

case=19782
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