www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Strange function

reply Orfeo <dlang orfeo.fastmail.com> writes:
In druntime (core/bitop.d line 302) I found this function

```
/**
  * Tests and resets (sets to 0) the bit.
  */
int btr(size_t* p, size_t bitnum) pure  system;

```



Honestly don't understand: where is the body of the function?

I thought I could find something like that:

```
int btr(size_t* p, size_t bitnum) pure  system {
   // body
}


Thank you
Nov 12 2019
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Tuesday, 12 November 2019 at 20:45:11 UTC, Orfeo wrote:
 In druntime (core/bitop.d line 302) I found this function
it is a magic function that the compiler recognizes and outputs a cpu instruction instead of a regular call. core.bitop has a few of those.
Nov 12 2019
parent Orfeo <dlang orfeo.fastmail.com> writes:
On Tuesday, 12 November 2019 at 21:05:35 UTC, Adam D. Ruppe wrote:
 On Tuesday, 12 November 2019 at 20:45:11 UTC, Orfeo wrote:
 In druntime (core/bitop.d line 302) I found this function
it is a magic function that the compiler recognizes and outputs a cpu instruction instead of a regular call. core.bitop has a few of those.
Wow! Thank you very much
Nov 12 2019