Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1528: Template / inline type problem

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
Erik Olofsson Posted - Jul 05 2006 : 12:35:08 PM
This realy simple code doesn't work. Originally I was trying to reproduce a problem with two inline classes that is named the same. In that case members from an unrelated class would be shown when completing.

template <typename t_CData>
class TCVector0
{
public:
	t_CData &operator [](size_t _Index)
	{
		static t_CData Ret;
		return Ret;
	}
/*
	const t_CData &operator [](int _Index) const
	{
		static t_CData Ret;
		return Ret;
	}*/
};


class CTest0
{
public:
	class CKeyTest
	{
	public:
		int m_Member0;
	};

	TCVector0<CKeyTest> m_Members;
};


class CTest1
{
public:
	class CKeyTest
	{
	public:
		int m_Member1;
	};

	TCVector0<CKeyTest> m_Members;
};

int main()
{
	CTest0 Test0;
	CTest1 Test1;
	Test0.m_Members[0].m_; // Does not work
	Test1.m_Members[0].m_; // Does not work

	TCVector0<CTest0> TestVector;
	TestVector[0].m_; // Works
	return 0;
}
4   L A T E S T    R E P L I E S    (Newest First)
support Posted - Jul 14 2008 : 2:33:32 PM
case=1607 is fixed in build 1645
feline Posted - Jul 08 2006 : 3:40:06 PM
using the second set of code you posted i am seeing the same problems.

case=1607
Erik Olofsson Posted - Jul 07 2006 : 10:26:49 AM
Visual Studio 2005 with VAX 1528

To reproduce: Clear caches and rebuild database.
Delete any files in vc8 dir in VAX install dir.
Create a new console project solution.
Put offending code there.

When I press Ctrl-space on the two first m_ I don't get any completion list at all.

The code below however "works". When I press ctrl-space at the first two I get m_Member3, but this is the wrong member.


template <typename t_CData>
class TCVector0
{
public:
	t_CData &operator [](size_t _Index)
	{
		static t_CData Ret;
		return Ret;
	}
/*
	const t_CData &operator [](int _Index) const
	{
		static t_CData Ret;
		return Ret;
	}*/
};


class CTest0
{
public:
	class CKeyTest
	{
	public:
		int m_Member0;
	};

	TCVector0<CKeyTest> m_Members;
};

class CTest1
{
public:
	class CKeyTest
	{
	public:
		int m_Member1;
	};

	TCVector0<CKeyTest> m_Members;
};

class CKeyTest
{
public:
	int m_Member3;
};

int main()
{
	CTest0 Test0;
	CTest1 Test1;
	Test0.m_Members[0].; // Displays wrong member
	Test1.m_Members[0].; // Displays wrong member

	TCVector0<CTest0> TestVector;
	TestVector[0].; // Works
	return 0;
}

feline Posted - Jul 06 2006 : 5:54:07 PM
which IDE and version of VA are you using?
using VS2003 and VA 1528 i have placed this code into a cpp file.

placing the caret after "m_" in the three marked places in main() and pressing CTRL-SPACE is inserting a member variable name for me. do you see this? are you seeing some other problem?

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