Bill Baxter wrote:
On Wed, Nov 11, 2009 at 1:16 PM, Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote:One option that hasn't been mentioned: private ref int myInt() { static int theInt; return theInt; } void fun(T)(T arg) { ... use myInt() ... }Is that a joke? That just replaces global symbol theInt with global symbol myInt. I don't see the win. --bb
Forgot to mention that the function gives you the opportunity to initialize the object in the general case.
Andrei