Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 "Create Implementation" with C++ templated classes

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
Knedl Posted - Dec 06 2014 : 11:29:52 AM
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
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Dec 06 2014 : 11:32:54 PM
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

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