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
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
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
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):
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