Re: Is there a way to bypass the file and line into D assert function ?

2019-07-22 Thread Newbie2019 via Digitalmars-d-learn
On Monday, 22 July 2019 at 09:54:13 UTC, Jacob Carlborg wrote: On 2019-07-19 22:16, Max Haughton wrote: Isn't assert a template (file and line) rather than a plain function call? No. It's a keyword, it's built-in to the compiler. It get extra benefits compared to a regular functions: the

Re: Is there a way to bypass the file and line into D assert function ?

2019-07-22 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-07-19 22:16, Max Haughton wrote: Isn't assert a template (file and line) rather than a plain function call? No. It's a keyword, it's built-in to the compiler. It get extra benefits compared to a regular functions: the asserts will be removed in release builds. -- /Jacob Carlborg

Re: Is there a way to bypass the file and line into D assert function ?

2019-07-19 Thread Max Haughton via Digitalmars-d-learn
On Friday, 19 July 2019 at 15:30:25 UTC, Newbie2019 wrote: for example: void ASSERT(string fmt, string file = __FILE_FULL_PATH__, size_t line = __LINE__, T...) (bool c, scope T a) @nogc { assert(c, string, file, line); } but i get this error: error.d(39): Error: found file when

Re: Is there a way to bypass the file and line into D assert function ?

2019-07-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-07-19 17:30, Newbie2019 wrote: for example: void ASSERT(string fmt, string file = __FILE_FULL_PATH__, size_t line = __LINE__, T...) (bool c, scope T a)  @nogc {    assert(c, string, file, line); } but i get this error: error.d(39): Error: found file when expecting ) error.d(39):

Is there a way to bypass the file and line into D assert function ?

2019-07-19 Thread Newbie2019 via Digitalmars-d-learn
for example: void ASSERT(string fmt, string file = __FILE_FULL_PATH__, size_t line = __LINE__, T...) (bool c, scope T a) @nogc { assert(c, string, file, line); } but i get this error: error.d(39): Error: found file when expecting ) error.d(39): Error: found ) when expecting ; following