Whole Tomato Software Forums
Main Site
|
Profile
|
Register
|
Active Topics
|
Members
|
Search
|
FAQ
All Forums
Visual Assist
Technical Support
1609: listbox entry for template specialization
You must be registered to post a reply.
Click
here
to register.
Screensize:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Blue
Brown
Green
Red
Violet
Yellow
Message:
Forum code
is on.
Html is off.
[quote][i]Originally posted by Frunobulax[/i] [br]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 = [red]Factory[/red]<_MyClass>::request(); lClass->doSomething(); return 0; } --- IDE is VS2005 SP1. Regards, Thomas [/quote]
Check to include your profile signature.
Check to subscribe to this topic.
T O P I C R E V I E W
Frunobulax
Posted - Oct 19 2007 : 08:19:39 AM
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
1 L A T E S T R E P L I E S (Newest First)
feline
Posted - Oct 19 2007 : 10:08:31 AM
I am seeing the same effect here. Thank you for the clear description.
case=9453
© 2023 Whole Tomato Software, LLC
Snitz Forums 2000