Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Problem with Find References

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
ShadowIce Posted - Dec 01 2014 : 09:06:28 AM
In the past few weeks I've noticed a problem with the find references function. It was getting really unreliable and most of the times I had to do a simple text search to get all the references. So I took some time to investigate why that happened and came up with this little example:


#define USE_STD_SMART_POINTERS

namespace mystd
{
#ifdef USE_STD_SMART_POINTERS
	using ::std::shared_ptr;
#else
	using ::boost::shared_ptr;
#endif
}

namespace foo
{
	class TestClass
	{
	public:
		TestClass() {}

		void Test() {}
	};

	class TestClassUser
	{
	public:
		TestClassUser()
		{
			m_t.reset(new TestClass());
			m_t->Test();		// not found

			mystd::shared_ptr<TestClass> t2 = m_t;
			t2->Test();		// also not found

			mystd::shared_ptr<TestClass> t(new TestClass());
			t->Test();		// found
		}

	private:
		mystd::shared_ptr<TestClass> m_t;
	};
}


Problem seems to be that there may be two possible implementations of shared_ptr. If I comment out one of them all references are found. I've tried using the va_stdafx.h file with a define for USE_STD_SMART_POINTERS but that didn't make any difference. Any idea how to fix this?

Tested in Visual Studio Professional 2013 (Update 4) with VAX 10.9.2052.
5   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Feb 13 2015 : 8:00:02 PM
case=86670 is fixed in build 2059
ShadowIce Posted - Dec 02 2014 : 03:21:09 AM
Yes, thank you. That worked perfectly.
sean Posted - Dec 01 2014 : 3:55:34 PM
Oops - that's a better workaround than none at all.
feline Posted - Dec 01 2014 : 3:52:36 PM
Are you able to edit the code, to change how the macro is used? Using your test code, I have changed it to read:

#define USE_STD_SMART_POINTERS
#define FELINE_STD_SMART_POINTERS using ::std::shared_ptr;
#define FELINE_BOOST_SMART_POINTERS using ::boost::shared_ptr;

namespace mystd
{
#ifdef USE_STD_SMART_POINTERS
	FELINE_STD_SMART_POINTERS
#else
	FELINE_BOOST_SMART_POINTERS
#endif
}


and added the following lines to the va_stdafx.h file, making sure the file ends with a blank line:

#define FELINE_STD_SMART_POINTERS using ::std::shared_ptr;
#define FELINE_BOOST_SMART_POINTERS


after rebuilding the VA symbol database, running Find References on the declaration of "Test" in "TestClass" is finding all 4 references, as expected. The obvious problem here is needing to update va_stdafx.h file when you change smart pointer classes.
sean Posted - Dec 01 2014 : 3:26:26 PM
Thanks for the test code. It demonstrates the problem clearly. I'm afraid we don't have a workaround but will investigate a proper fix. case=86670

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