Re: How to specify an object that can be mutable or immutable

On Thu, 26 Sep 2013 15:11:52 +0200, Dirk Schulze <dschulze@adobe.com>  
wrote:

> Hmm, then every method that can take both as argument, also must specify  
> both every time. Beside that, you also need to implement each interface  
> twice. One for the mutable case, on for the immutable. Means you have  
> duplication all over the platform.

Not everything needs to support both immutable and mutable objects, but  
otherwise, yeah.

We can solve the "have to specify both every time" by defining a typedef,  
like:

typedef (DOMRect or DOMRectImmutable) DOMRectAny;


> That sound suboptimal.

I think it is the least bad option suggested so far.

-- 
Simon Pieters
Opera Software

Received on Thursday, 26 September 2013 13:24:59 UTC