Problems using kdatetime.h with msvc

David Jarvie lists at astrojar.org.uk
Tue May 2 21:49:59 BST 2006


On Tuesday 02 May 2006 18:17, Thiago Macieira wrote:
> Christian Ehrlicher wrote:
> >Hi,
> >
> >I get some compile errors when I try to use kdatetime.h
> > (kdatetimetest.cpp). The problem is the usage of OffsetFromUTC,
> > LocalZone and maybe others as an enum and a function within the same
> > namespace:
> >
> >---------------8<-------------
> > Error Message
> >'OffsetFromUTC' : the name of a function parameter cannot be qualified
> >
> >You cannot use a qualified name as a function parameter.
> >---------------8<-------------
> >
> >I think it is not allowed because the compiler can't distinguish between
> >the enum and the adress for the function.
>
> I can see that, but I cannot understand your compilation error.
>
> The static function OffsetFromUTC is part of the Spec sub-class. There
> should be no errors.
>
> Unless, of course, the code that is failing is inside the Spec sub-class.
>
> djarvie: why is that function named with an uppercase letter?

It is named specifically to be the same as the enum member's name. There is 
another static function Spec::LocalZone() which is also named identically to 
another of the enum's members, and there are two static const member values 
in Spec which are named the same as another two members of the enum. The 
naming is to make clear the close relationship between the enum values and 
the Spec members - each of these Spec members returns an Spec instance of the 
appropriate type.

-- 
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/linux/kalarm.html

-- 
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/linux/kalarm.html




More information about the kde-core-devel mailing list