[Issue 6857] Precondition contract checks should be statically bound.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 9 15:22:27 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6857
--- Comment #79 from Stewart Gordon <smjg at iname.com> 2012-07-09 15:22:23 PDT ---
(In reply to comment #78)
> As Walter said, that requires argument forwarding, which introduces copying
> problems and doesn't work with variadics.
I thought I'd debunked that, but you're right. By my proposal, user code would
be calling either foo_dbc or foo depending on whether it's compiled in dev or
release mode. And foo_dbc forwards to foo.
But it does seem to be down to two problems with D's design:
- structs aren't guaranteed to be safe to just bit-copy (this problem was
introduced in D2)
- we have variadics that are really just C's variadics with typeinfo added
Something else I should've realised earlier: Why do D class methods need to be
directly callable from C? (How does C code hold a reference to a D object,
anyway?) Indeed, is even C++ designed to accommodate this?
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list