Boost logo

Boost :

From: Karl Nelson (kenelson_at_[hidden])
Date: 2000-11-17 20:01:27


> >> I believe that we need partial specialization in any case. Even if we
> >>use Callback0, Callback1, etc. classes, we still (might) need a void
> >>(partial) specialization. e.g.,
> >
> >That isn't true. Libsigc++ does not require partial specialization
> >on VC++ because for that platform you can cast a void (*)(int) to
> >an int (*)(int) and then ignore the bogus return. Thus you
> >simply require traits to change trait<void>::return_type to
> >int.
>
> Pretty scary to do something like this in code that's supposed to be
> portable. Also this prevents you from treating functors and free functions
> in the same way.

Just for reference, this is portable in that I only enable it for
the one platform (Virtually-working C++) where partial specialization
isn't an option. All other platforms use the normal partial
specialization save for SGI which is even more broken and requires
extra specializations.

Note, void returns also avoid most of the problem in that this is allowed
as per the standard.

  void foo();
  void call()
    {
      return foo();
    }

--Karl


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