On Wednesday, 16 May 2018 at 19:16:11 UTC, Manu wrote:
I'm wondering if it should also be possible to apply in/out
contracts
to function prototypes?
Contracts should be checked by the caller, yes, and the idea
regularly pops up here, I though there's an issue for this, but
can't find
On Wednesday, 16 May 2018 at 19:16:11 UTC, Manu wrote:
I'm wondering if it should also be possible to apply in/out
contracts
to function prototypes?
This came up when DIP1009 (improve contract syntax) was accepted.
Relevant thread:
https://forum.dlang.org/post/mailman.2332.1523425401.3374
imisations.
> > >
> > > I often call to extern C/C++ code, or even to D code built in a static
> > > lib with a .di as interface.
> > > Sadly, in/out contracts can not be used and offer no advantage in
> > > these cases, because calls are
> > lib with a .di as interface.
> > Sadly, in/out contracts can not be used and offer no advantage in
> > these cases, because calls are made via function prototypes.
> >
> > I'm wondering if it should also be possible to apply in/out contracts
> > to func
prototypes.
>
> I'm wondering if it should also be possible to apply in/out contracts
> to function prototypes?
> They are usually evaluated in the entry/exit blocks when compiling
> functions, but when applied to prototypes, they would rather need to
> be evaluated immediate
++ code, or even to D code built in a static
lib with a .di as interface.
Sadly, in/out contracts can not be used and offer no advantage in
these cases, because calls are made via function prototypes.
I'm wondering if it should also be possible to apply in/out contracts
to function prototypes