When is a slice not a slice?

Jesse Phillips via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 17 19:45:38 PDT 2014


On Thursday, 5 June 2014 at 19:45:59 UTC, Alix Pexton wrote:
> unittest
> {
> 	auto a = DataAndView(1);
> 	assert (sameTail(a.data, a.view));
> 	enum b = DataAndView(1);
> 	assert (!sameTail(b.data, b.view));
> }

Just a request of presentation. Please make expected assertions:

     enum b = DataAndView(1);
     assert (sameTail(b.data, b.view)); // fails

Where the comment could be "fails" "compile error" "ice" "baby"

It documents expectations, documents what went wrong, and 
provides a program which demonstrates the issue.


More information about the Digitalmars-d-learn mailing list