On Tue, Oct 01, 2013 at 01:13:37PM -0700, Botond Ballo wrote: > > - final on data / non virtual member functions > > - virtual constants (maybe ability to get at vtable pointer too?) > > - ability to say classes should only be used on stack / heap or not used > > in one of those > > > > It would be nice to know if we can interest people in supporting any > > of those. > > I'm not sure what "final on data" means, can you elaborate on that?
something like this class Foo : public nsISomething { nsrefcount mRfcnt final; }; class SpecialFoo : public Foo { nsrefcount mRfcnt; // Should not compile, is not ok, is footgun! }; > For the other things, I'm not aware of any active proposals for these > things. I will post a follow-up email that describes the Committee's > procedure for making proposals for new language features, in case > anyone is interested in proposing these. maybe someone should look into doing that > I should mention that forcing a class to be allocated on the stack > or heap can already be accomplished to some extent. (To force a > class to be allocated on the heap, declare its destructor private, > allocate it using "new", and delete it by calling a member function > that calls "delete this". To force a class to be allocated on the > stack, give it private operator new and delete members.) Of course > these techniques are not perfect and a built-in language feature > for doing this would be nicer. yeah, those are pretty poor substitutes, for example the operator new / delte thing doesn't prevent globals of the type afaik. Trev > > Botond _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform