Re: About CTFE and pointers

2012-02-24 Thread Don Clugston
On 24/02/12 15:18, Alex Rønne Petersen wrote: On 24-02-2012 15:08, bearophile wrote: I have seen this C++11 program: http://kaizer.se/wiki/log/post/C++_constexpr/ I have translated it to this D code: bool notEnd(const char *s, const int n) { return s&& s[n]; } bool strPrefix(const char *s, co

Re: About CTFE and pointers

2012-02-24 Thread Alex Rønne Petersen
On 24-02-2012 15:08, bearophile wrote: I have seen this C++11 program: http://kaizer.se/wiki/log/post/C++_constexpr/ I have translated it to this D code: bool notEnd(const char *s, const int n) { return s&& s[n]; } bool strPrefix(const char *s, const char *t, const int ns, const int nt)

About CTFE and pointers

2012-02-24 Thread bearophile
I have seen this C++11 program: http://kaizer.se/wiki/log/post/C++_constexpr/ I have translated it to this D code: bool notEnd(const char *s, const int n) { return s && s[n]; } bool strPrefix(const char *s, const char *t, const int ns, const int nt) { return (s == t) || !t[nt]