Re: [sigc] TypeLists!!!



Am 11.06.2004 19:01:33 schrieb(en) "Lemings, Eric B.":

>> Lemings, Eric B. wrote:
>>
>>> The current Libsigc++ API (2.0.3) is in desperate need of
>>> typelists.  Typelists would make the API much simpler and
>>> easier to use.  Has this been proposed/discussed before?
>>
>> The library used in the book is called Loki.  The
>> code for it can be found at SourceForge.
>
> I believe the question is: how are typelists going to
> simplify the API? Can you give a before / after example?
>
> Tim

All template parameters lists in the API similar to this:

  template
  <
    class T_type1,
    class T_type2,
    ...
  >

can be replace with one template parameter:

  template
  <
    typename TList
  >

In public API? Wouldn't this mean that you needed to add an additional keyword to your signal / slot declaration like e.g.:

 sigc::signal<TList<void,int> > sig1;

instead of:

 sigc::signal<void,int> sig1;

? I don't believe our users would be convenient with this.

Not only will that allow more than seven template parameters
(currently supported in the API)

IMHO, there is something horribly wrong in your app if you need >5 arguments to a function.

, it will reduce the API
seven-fold since each new template will replace seven existing
templates.

This is the reason why using typelists might be desirable. However, I'm afraid the remaining templates would become even harder to read ...

If it has no other advantage on the public API side apart from being able to specify >7 arguments I'm not in favour of using typelists.

Regards,

 Martin



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