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
 1609: listbox entry for template specialization
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Frunobulax
Ketchup Master

84 Posts

Posted - Oct 19 2007 :  08:19:39 AM  Show Profile  Reply with Quote
Hi,

in the following code VAX will suggest only FactoryDefaultImpl instead of Factory in the red colored spot:

----
// VAX.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>

template<class T>
class Factory;

class _MyClass {
public:
void doSomething(void) {}
};

typedef boost::shared_ptr<_MyClass> MyClass;

template<class _ValueObject>
class FactoryDefaultImpl : boost::noncopyable {
public:
static boost::shared_ptr<_ValueObject> request(void) { return boost::shared_ptr<_ValueObject>(new _ValueObject); }
};


template<> class Factory<_MyClass> :
public FactoryDefaultImpl<_MyClass> {
public:
void foo(void);
};


int _tmain(int argc, _TCHAR* argv[])
{
MyClass lClass = Factory<_MyClass>::request();

lClass->doSomething();
return 0;
}

---

IDE is VS2005 SP1.

Regards, Thomas

"The nice part about being a pessimist
is that you are constantly being either
proven right or pleasantly surprised."
(George F. Will)

feline
Whole Tomato Software

United Kingdom
19001 Posts

Posted - Oct 19 2007 :  10:08:31 AM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=9453

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