Menu

- Learn
- Documentation
  - Language Reference
  - Library Reference
  - Command-line Reference
  - Feature Overview
  - Articles
- Downloads
- Packages
- Community
  - Blog
  - Orgs using D
  - Twitter
  - Calendar
  - Forums
  - IRC
  - Community Discord
  - Wiki
  - GitHub
  - Issues
  - Get involved
  - Contributors
  - Foundation
  - Security Team
  - Donate
  - Sponsors
- Resources
  - Tour
  - Books
  - Tutorials
  - Tools
  - Editors
  - IDEs
  - run.dlang.io
  - Visual D
  - Acknowledgments
  - D Style
  - Glossary
  - Sitemap

Search
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

# core.internal.dassert

string `_d_assert_fail`(string op, A)(auto ref scope const A `a`);
  Generates rich assert error messages for unary expressions
  The unary expression assert(!una) will be turned into assert(!una, `_d_assert_fail`!"!"(una)). This routine simply acts as if the user wrote assert(una == false).
  Parameters:

  op | Operator that was used in the expression, currently only "!" is supported.
  A `a` | Result of the expression that was used in assert before its implicit conversion to bool.

  Returns:
  A string such as "a != true" or "a == true".
string `_d_assert_fail`(string comp, A, B)(auto ref scope const A `a`, auto ref scope const B `b`);
  Generates rich assert error messages for binary expressions
  The binary expression assert(x == y) will be turned into assert(x == y, `_d_assert_fail`!"=="(x, y)).
  Parameters:

  comp | Comparison operator that was used in the expression.
  A `a` | Left hand side operand.
  B `b` | Right hand side operand.

  Returns:
  A string such as "a $comp b".

Copyright © 1999-2021 by the D Language Foundation | Page generated by Ddoc on Thu Feb 18 11:53:12 2021