Multimobile Development: Building Applications for any Smartphone
VC7.0: const qualifier on 'void' type is ignored
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.vc.


Aleksey Gurtovoy
GOOD ANSWER
As the following code highlights, VC7.0 ignores 'const' qualifier on 'void'
type when it's used as template argument:

[void_const_vc7.cpp]
template<typename T> struct memory_block;
template<> struct memory_block<void> {};
template<> struct memory_block<void const> {}; // error C2908, see below

[compiler output]
e:\depot\bugs\void_const_vc7.cpp(3) : error C2908: explicit specialization;
'memory_block<T>' has already been instantiated from the primary template
with
[
T=void
]

, which is clearly not a correct behavior.

--
Aleksey

Reply to this message...
Vote that this is a GOOD answer... (2 votes from other users already)
 
 
    
Ronald Laeremans [MSFT]
GOOD ANSWER
However, this one will ship broken in VC 7.0 RTM. We will have it working
for the next version.

Ronald Laeremans
Visual C++ compiler team

"Aleksey Gurtovoy" <Click here to reveal e-mail address> wrote in message
news:#gutCraQBHA.404@tkmsftngp03...
> As the following code highlights, VC7.0 ignores 'const' qualifier on
'void'
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer... (2 votes from other users already)
 
 
 




Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Multimobile Development: Building Applications for any Smartphone
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734