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
 "Create Implementation" with C++ templated classes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Knedl
Starting Member

1 Posts

Posted - Dec 06 2014 :  11:29:52 AM  Show Profile  Reply with Quote
Hello.

"Create Implementation" does not work well on C++ templated classes.

For example, I have

namespace TestNS
{

template<class A, class B, class C>
class TestClass
{
public:
	typedef int TestTypedef;

	void func1();

	TestTypedef func2();

	template<class T>
	void func3(T t);
};

}


If i go "Create Implementation" on func1, the output is:

template<class A, class B, class C>
void TestNS::TestClass<A, B, C>::func1()
{

}

This in only a nitpicking - TestNS:: is not necessary, the implementation is created inside TestNS namespace already. I can live with that, this is not a problem yet.



Lets go "Create Implementation" on func2:

template<class A, class B, class C>
TestTypedef TestNS::TestClass<A, B, C>::func2()
{

}

First real issue. This code is wrong. There must be "typename TestClass<A, B, C>::TestTypedef" instead of plain "TestTypedef".



Lets try it also on func3:

template<class T>
void TestNS::TestClass::func3( T t )
{

}

Totally wrong. It is supposed to be

template<class A, class B, class C>
template<class T>
void TestClass<A, B, C>::func3( T t )
{

}

Otherwise it will not compile.

I am working with templates a lot and having this feature working will save me a lot of time.

BR
Knedl

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Dec 06 2014 :  11:32:54 PM  Show Profile  Reply with Quote
Thank you for the very clear description and examples, I am seeing the same problems here. func1, with the extra namespace, this is a known problem:

case=4240

As you say, just a minor point, but good to be aware of.

Function 2, that is not helpful, I have put in a bug report for this:

case=86792

Function 3, this is a known problem that we are hoping to look into relatively soon:

case=5476

zen is the art of being at one with the two'ness
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