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
 1530: Wrong intellisense scope for subclasses
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

drzoom
Ketchup Master

Switzerland
57 Posts

Posted - Jul 12 2006 :  03:42:19 AM  Show Profile  Reply with Quote
The next example is a little bit complicated, but it shows exactly the problem:

example.h:



#pragma once

class Deformation
{
public:
	Deformation();
	~Deformation();
private:
	int m_deformationLevel;
};

namespace airplane {
namespace crashs {

class Grounding
{
	class Deformation;
public:
	Grounding();
	~Grounding();
	const Grounding& operator=( const Grounding& assign );
public:
	int getVictimCount() const;
private:
	int m_victimCount;
};

class Grounding::Deformation
{
public:
	Deformation();
	Deformation( const Deformation& copy );
	~Deformation();
	const Deformation& operator=( const Deformation& assign );
	int getStrength() const;
private:
	int m_strength;
};

}
}




example.cpp:



#include "example.h"

Deformation::Deformation() 
{
}
Deformation::~Deformation() 
{
}

namespace airplane {
namespace crashs {

Grounding::Grounding() 
{
}
Grounding::~Grounding() 
{
}
const Grounding& Grounding::operator=( const Grounding& assign ) 
{
	m_victimCount = assign.m_victimCount;
	return assign;
}
int Grounding::getVictimCount() const
{
	return m_victimCount;
}
Grounding::Deformation::Deformation()
{
}
Grounding::Deformation::Deformation( const Deformation& copy )
{
}
Grounding::Deformation::~Deformation()
{
}
const Grounding::Deformation& Grounding::Deformation::operator=( const Deformation& assign )
{
	// HERE! try scope of "assign".
	m_strength = assign.m_strength;
	return assign;
}
int Grounding::Deformation::getStrength() const
{
	return m_strength;
}

}
}




Go to the implementation file, to the place maked with "HERE!" and type in a new line "assign." and look to the suggestions you get.

You should get the attributes from the class "::airplane::crashes::Grounding::Deformation", but you get the attributes from the class "::Deformation". Thats wrong, and not only a very rare case.

If you use a Library which is declaring many classes in the global namespace, and you use namespaces and subclasses to avoid naming clashes, then always if you "solve" a conflict by using a private subclass (e.g. Action) you hve this problem.

In my case, I get conflicts with windows classes/enums like "Action".

best regards
Tobias

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 12 2006 :  7:40:50 PM  Show Profile  Reply with Quote
that took a bit of thinking about, especially since for me the VA wizard bar is getting this right, while the suggestions are wrong.

case=1666

zen is the art of being at one with the two'ness
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Dec 19 2006 :  9:23:38 PM  Show Profile  Reply with Quote
case=1666 is fixed in build 1543
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