On 6/26/23 2:42 PM, Cecil Ward wrote:
==
{
size_t p = offset;
++p;
scope(exit) { writeOutput( 0, p );
++p
…
++p;
return;
}
==
The correctness of its behaviour depends on what the value of p is when
it calls writeOutput(), and the value of p is being changed. To be
correct, the final value
On Monday, 26 June 2023 at 17:41:16 UTC, Paul Backus wrote:
On Saturday, 24 June 2023 at 17:00:36 UTC, Cecil Ward wrote:
I would like to use scope guards but in the guard I need to
get access to some local variables at the end of the routine.
This doesn’t really seem to make sense as to how it
On Saturday, 24 June 2023 at 17:00:36 UTC, Cecil Ward wrote:
I would like to use scope guards but in the guard I need to get
access to some local variables at the end of the routine. This
doesn’t really seem to make sense as to how it would work,
because their values depend on the exact point
On 5/21/18 1:50 PM, Robert M. Münch wrote:
On 2018-05-21 17:24:12 +, Steven Schveighoffer said:
I'm not 100% sure but I expect:
scope(failure)
someCode();
putting a breakpoint on someCode should work.
When calling a function an then setting the breakpoint there, like in
someCode()
On 2018-05-21 17:24:12 +, Steven Schveighoffer said:
I'm not 100% sure but I expect:
scope(failure)
someCode();
putting a breakpoint on someCode should work.
When calling a function an then setting the breakpoint there, like in
someCode() yes, that should work.
I used code like th
On 5/21/18 1:00 PM, Robert M. Münch wrote:
If I use scope(failure) with code that should be run if an exception is
thrown, how can I set a breakpoint for this code in the debugger?
I'm not 100% sure but I expect:
scope(failure)
someCode();
putting a breakpoint on someCode should work.
-
If I use scope(failure) with code that should be run if an exception is
thrown, how can I set a breakpoint for this code in the debugger?
--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
Mike Parker via
Digitalmars-d-learn wrote:
> On Thursday, 8 February 2018 at 10:09:12 UTC, Timothee Cour
> wrote:
>>
>> I'm curious whether scope guards add any cost over the
>> naive way, eg:
>>
>> ```
>> void fun(){
>> ...
>>
On Thursday, 8 February 2018 at 10:44:37 UTC, Mike Parker wrote:
On Thursday, 8 February 2018 at 10:09:12 UTC, Timothee Cour
wrote:
I'm curious whether scope guards add any cost over the naive
way, eg:
```
void fun(){
...
scope(success) {bar;}
...
}
```
vs:
```
void fun(){
...
zer before each return
> statement) in the case where no exception is thrown
>
>
> On Thu, Feb 8, 2018 at 2:44 AM, Mike Parker via Digitalmars-d-learn
> wrote:
> > On Thursday, 8 February 2018 at 10:09:12 UTC, Timothee Cour wrote:
> >>
> >> I'
ia Digitalmars-d-learn
>> wrote:
>> > On Thursday, 8 February 2018 at 10:09:12 UTC, Timothee Cour wrote:
>> >>
>> >> I'm curious whether scope guards add any cost over the naive way, eg:
>> >>
>> >> ```
>> >> void fun(
February 2018 at 10:09:12 UTC, Timothee Cour wrote:
>>
>> I'm curious whether scope guards add any cost over the naive way, eg:
>>
>> ```
>> void fun(){
>> ...
>> scope(success) {bar;}
>> ...
>> }
>> ```
>>
>> vs:
&g
On Thursday, 8 February 2018 at 10:09:12 UTC, Timothee Cour wrote:
I'm curious whether scope guards add any cost over the naive
way, eg:
```
void fun(){
...
scope(success) {bar;}
...
}
```
vs:
```
void fun(){
...
if(foo1){
bar; // add this before each return
r
at 2:09 AM, Timothee Cour wrote:
> I'm curious whether scope guards add any cost over the naive way, eg:
>
> ```
> void fun(){
> ...
> scope(success) {bar;}
> ...
> }
> ```
>
> vs:
>
> ```
> void fun(){
> ...
> if(foo1){
&g
I'm curious whether scope guards add any cost over the naive way, eg:
```
void fun(){
...
scope(success) {bar;}
...
}
```
vs:
```
void fun(){
...
if(foo1){
bar; // add this before each return
return;
}
...
bar;
return;
}
```
For scope(success) and scope(failure)
15 matches
Mail list logo