Boost logo

Boost :

From: Jesse Jones (jesjones_at_[hidden])
Date: 2000-11-23 18:42:01


>In message <200011230802.AAA18963_at_[hidden]>, Jesse Jones
><jesjones_at_[hidden]> writes
>>I've uploaded a new version of my callbacks to the Callbacks2 directory.
>>It includes the following changes:
>>
>>1) A compile time error is emitted if too few arguments are used when
>>calling the callback. I pretty much took the approach recommended by
>>Gregor and added numbered base class objects.
>>2) The return type no longer has to be default constructable.
>>3) Renamed boost::details::unused unused_arg (in the hope that this would
>>be slightly clearer to clients).
>>4) The method ctors no longer require raw pointers.
>>5) Sprinkled some typename keywords here and there as recommended by
>>Gregor.
>
>All sounds good.

BTW I left the operator()() methods const. If you can call a const
function pointer it seems like you should be able to do the same with a
callback...

>>6) Replaced NULL with 0 (Gregor says NULL was causing problems with GCC).
>>This change stinks. :-)
>
>Couldn't disagree more :-> NULL is, depending on your sensibilities,
>either a C-ism or an MS-ism, but it's not generally considered part of
>the received C++ style.

You're painting with an awfully broad brush here. :-) Plenty of people
think the way C overloads 0 impairs readibility.

>Speaking of stylistic elements, is it possible to move the code towards
>more conventional C++ naming? Eg function objects instead of functors (a
>bit early 90s, that ;->) and member functions instead of methods? Not a
>big issue, but it affects my comfort level :-)

Well the current names are just as clear as what you're proposing and
they happen to be shorter...

  -- Jesse


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk