Thread overview | |||||
---|---|---|---|---|---|
|
November 19, 2013 How does noexcept work? | ||||
---|---|---|---|---|
| ||||
If I have a function: @safe pure void functionName() { return; } Where do I put the noexcept? |
November 19, 2013 Re: How does noexcept work? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeroen Bollen | On Tuesday, 19 November 2013 at 18:01:19 UTC, Jeroen Bollen wrote:
> If I have a function:
> @safe pure void functionName() {
> return;
> }
> Where do I put the noexcept?
Did you mean nothrow?
You can put it unfortunately on both sides.
left:
@safe pure nothrow void functionName() {
return;
}
right:
@safe pure void functionName() nothrow {
return;
}
|
November 19, 2013 Re: How does noexcept work? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Namespace | On Tuesday, 19 November 2013 at 18:09:29 UTC, Namespace wrote:
> On Tuesday, 19 November 2013 at 18:01:19 UTC, Jeroen Bollen wrote:
>> If I have a function:
>> @safe pure void functionName() {
>> return;
>> }
>> Where do I put the noexcept?
>
> Did you mean nothrow?
> You can put it unfortunately on both sides.
> left:
>
> @safe pure nothrow void functionName() {
> return;
> }
>
> right:
> @safe pure void functionName() nothrow {
> return;
> }
Thanks, don't mind me being stupid. I was getting confused with C++. *facepalm*
|
Copyright © 1999-2021 by the D Language Foundation