This repository was archived by the owner on Oct 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2748,39 +2748,6 @@ if (is(typeof(create()) : V) && is(typeof(update(aa[K.init])) : V))
27482748 assert (a[" 1" ] == - 2 );
27492749}
27502750
2751- version (none )
2752- {
2753- // enforce() copied from Phobos std.contracts for destroy(), left out until
2754- // we decide whether to use it.
2755-
2756-
2757- T _enforce (T, string file = __FILE__ , int line = __LINE__ )
2758- (T value, lazy const (char )[] msg = null )
2759- {
2760- if (! value) bailOut(file, line, msg);
2761- return value;
2762- }
2763-
2764- T _enforce (T, string file = __FILE__ , int line = __LINE__ )
2765- (T value, scope void delegate () dg)
2766- {
2767- if (! value) dg();
2768- return value;
2769- }
2770-
2771- T _enforce (T)(T value, lazy Exception ex)
2772- {
2773- if (! value) throw ex();
2774- return value;
2775- }
2776-
2777- private void _bailOut (string file, int line, in char [] msg)
2778- {
2779- char [21 ] buf = void ;
2780- throw new Exception (cast (string )(file ~ " (" ~ ulongToString(buf[], line) ~ " ): " ~ (msg ? msg : " Enforcement failed" )));
2781- }
2782- }
2783-
27842751version (CoreDdoc)
27852752{
27862753 // This lets DDoc produce better documentation.
You can’t perform that action at this time.
0 commit comments