Hi Erwin,

This is a totally fair point.  The default constructor is useful; some 
people want arrays of timers, for which a default constructor is 
required.  But I've made Click generate a warning when a 
default-constructed Timer is initialized.

Eddie


Erwin Van de Velde wrote:
> Dear all,
> 
> The Timer class has a default constructor, but when you use it (e.g. you 
> accidently forget to put fTimer(this) or something like that in your element 
> constructor), you are left with a timer that does nothing, even after calling 
> the initialize function on the timer. For me this resulted in a bug, which 
> was 
> quite hard to find.
> 
> So I am suggesting:
> - Removing the default constructor of the timer if it has no use (I do not 
> see 
> any)
> - Adding a click_chatter with a warning in the default constructor if it is 
> required.
> 
> Best regards,
> Erwin
> _______________________________________________
> click mailing list
> [email protected]
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
_______________________________________________
click mailing list
[email protected]
https://amsterdam.lcs.mit.edu/mailman/listinfo/click

Reply via email to