[sv-ec] "this" as default argument

From: Michael Burns <michael.burns_at_.....>
Date: Thu Mar 30 2006 - 15:53:27 PST
Hi folks,

Is it the intent of the committee that "this" should be a valid default 
argument value for class methods? For example,

class Foo;
...

  task mytask(Foo f = this);
     ...
  endtask
endclass

The 1800 standard seems to suggest this (12.4.3, "The default_value is 
an expression. The expression is evaluated in the scope containing the 
subroutine declaration each time a call using the default is made"), but 
section 7.10 makes it a little less clear ("The this keyword shall only 
be used within nonstatic class methods") - does use as a default value 
in the method's arg list count as being "within" the method?

--Mike Burns
Freescale Semiconductor
Received on Thu Mar 30 15:53:37 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 30 2006 - 15:53:47 PST