[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: kconfigxt singleton problem?
From:       Alexander Petrov <zowers () gmail ! com>
Date:       2006-06-06 22:33:57
Message-ID: 200606070234.02133.zowers () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hi,

On Wednesday 07 June 2006 01:38 Robert Hogan wrote:
> mykconfigxt.h:
>     static
>     bool defaultMaxMinOptions()
>     {
>       return self()->mDefaultMaxMinOptions;
>     }
>
>
> my.cpp:
>
> bool (MyKConfigxt::*pt2Member)() = NULL;
> pt2Member = &MyKConfigxt::defaultMaxMinOptions;
>
> gives
> error: cannot convert `bool (*)()' to `bool (MyKConfigxt::*)()' in
> assignment

you need Class::*memfun syntax only for non-static member functions,
so either remove 'static' from defaultMaxMinOptions() declaration or define 
pointer as pointer to free-standing function and use your static function as 
pointee:

bool (*funptr)() = NULL;
funptr = &MyKConfigxt::defaultMaxMinOptions;

btw: consider using Boost.Bind / Boost.Function, which are very flexible 
classes to bind to functions

-- 
BR. Alexander 'zowers' Petrov.    jabber:zowers@jabber.ru    icq:69694782
http://zowers.narod.ru            mailto:zowers@gmail.com

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic