Mercurial > projects > dstress
view run/c/const_45_A.d @ 1619:bebc7472a832
Fix #7.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 07 Nov 2009 18:55:30 +0100 |
parents | abcf8e538bac |
children |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ // @author@ Bill Baxter <dnewsgroup@billbaxter.com> // @date@ 2007-02-16 // @uri@ http://www.digitalmars.com/webnews/newsgroups.php?group=digitalmars.D&article_id=48869 // @desc@ Re: Compile time function execution... module dstress.run.c.const_45_A; char[] UpToSpace(char[] x){ int i=0; while (i<x.length && x[i] != ' ') { i++; } return x[0..i]; } int main(){ const y = UpToSpace("first space was after first"); if("first" != y){ assert(0); } return 0; }