lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] callback.hpp vs boost::function


From: Greg Chicares
Subject: Re: [lmi] callback.hpp vs boost::function
Date: Sun, 30 Oct 2005 21:28:44 +0000
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

On 2005-10-30 20:52 UTC, Vadim Zeitlin wrote:
> 
>  while fixing this file to compile with g++ 4.0

BTW, I'm working on getting a clean compile with g++-3.4.4 now. The
worst problem I've found is described here
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22207
and can be worked around by specifying '-Wno-uninitialized'. Was that
a problem with 4.0 as well? If not, I'll use the workaround only for
3.4.4 <= version < 4.0 .

Have you found many other problems with 4.0 ? Please let me know so
that we can avoid duplicating each others' work. I'm fixing some expm1()
warnings right now. Wendy pointed out a 3.4.4 problem with mpatrol that
I haven't yet looked into.

> (for the curious, it was
> just a missing typename keyword: compiler can't know that the expression
> boost::xxx<T>::type is a type for any template parameter T, so you have to
> tell it that it is),

Thanks for fixing that.

> I couldn't avoid asking myself why does this callback
> class exist at all and why is not boost::function used instead?

Just my ignorance of that boost library, I guess.

> It looks it
> does exactly the same thing but boost::function is, of course, much more
> general (even if it's not needed now it surely doesn't harm) and, another
> big advantage, it's alreay written, tested and debugged, so why reinvent it?
> 
>  Please let me know if I'm missing something,

I had used a similar technique in 'alert*.?pp' and again in
'progress_meter*.?pp'. When I saw myself doing the same thing yet again
in 'file_command*.?pp', I decided that it was time to abstract the
technique and write unit tests for it. But if boost::function really
does exactly the same thing, then it's better to use theirs in all
those cases.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]