G
Guest
I'm attempting to convert an existing VC6++ project to .NET.
The project makes use of Microsoft's old VisSDK and this uses templates all
over the place, generating 100's of errors.
One common error is to do with this new 'typename' keyword - are there any
#pragma's, or compiler options, that force the compiler to use the old method
?
Whilst I've used templates, I've never designed one myself and am a bit
lost. For example, I get the following warning :-
c:\Projects\VisSDK\inc\VisStlWrappers.h(163) : warning C4346:
'std::map<_Kty,_Ty,_Pr,_Alloc>::value_compare' : dependent name is not a type
prefix with 'typename' to indicate a type
The code fragment is :-
template<class _K, class _Ty, class _Pr = std::less<_K>,
class _A = std::allocator<_Ty> >
class CVisStlMap {
public:
typedef CVisStlMap<_K, _Ty, _Pr, _A> T_This;
typedef std::map<_K, _Ty, _Pr, _A> T_Map;
typedef std:air<const _K, _Ty> value_type;
typedef T_Map::_Kfn _Kfn; <---line 163
Where does "typename" go ???
TTFN,
Jon
The project makes use of Microsoft's old VisSDK and this uses templates all
over the place, generating 100's of errors.
One common error is to do with this new 'typename' keyword - are there any
#pragma's, or compiler options, that force the compiler to use the old method
?
Whilst I've used templates, I've never designed one myself and am a bit
lost. For example, I get the following warning :-
c:\Projects\VisSDK\inc\VisStlWrappers.h(163) : warning C4346:
'std::map<_Kty,_Ty,_Pr,_Alloc>::value_compare' : dependent name is not a type
prefix with 'typename' to indicate a type
The code fragment is :-
template<class _K, class _Ty, class _Pr = std::less<_K>,
class _A = std::allocator<_Ty> >
class CVisStlMap {
public:
typedef CVisStlMap<_K, _Ty, _Pr, _A> T_This;
typedef std::map<_K, _Ty, _Pr, _A> T_Map;
typedef std:air<const _K, _Ty> value_type;
typedef T_Map::_Kfn _Kfn; <---line 163
Where does "typename" go ???
TTFN,
Jon