Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c++ Subject: Re: C++20 concepts rocks Date: Sun, 06 Feb 2022 04:58:23 -0800 Organization: A noiseless patient Spider Lines: 20 Message-ID: <86o83kjgnk.fsf@linuxsc.com> References: <87k0easj5d.fsf@bsb.me.uk> <865yptlpgf.fsf@linuxsc.com> <86wni8jodo.fsf@linuxsc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="a80c60510ddf69c3dc6a890da3a37a42"; logging-data="17335"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Er27QWZQXqzpwLky0BWDLtS8oDQW19O4=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:l4uJiC1NKr/8KEEfQLYYgneTpRU= sha1:orUF2MthD8iqJgShHFd+AeIlFD8= Xref: csiph.com comp.lang.c++:82936 "Alf P. Steinbach" writes: > On 6 Feb 2022 11:11, Tim Rentsch wrote: > >> red floyd writes: [...] >>> Why not just >>> >>> char *ep = result + sizeof(result)? >> >> My usual practice is a somewhat different construction, suitably >> encapsulated so as not to sprinkle idiomatic phrases throughout >> the main program text. > > Consider just using `std::end` rather than a DIY encapsulation. When feasible, I prefer constructions that work in both C and C++.