Deutsch English Français Italiano |
<vlnrvb$2dkpd$7@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Julio Di Egidio <julio@diegidio.name> Newsgroups: comp.lang.c Subject: Re: So You Think You Can Const? Date: Thu, 9 Jan 2025 07:56:42 +0100 Organization: A noiseless patient Spider Lines: 19 Message-ID: <vlnrvb$2dkpd$7@dont-email.me> References: <vljvh3$27msl$1@dont-email.me> <20250107130809.661@kylheku.com> <vlm0hf$2dkpd$1@dont-email.me> <87a5c15ob0.fsf@bsb.me.uk> <vlm7o4$2dkpd$4@dont-email.me> <87r05c4x2c.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 09 Jan 2025 07:56:43 +0100 (CET) Injection-Info: dont-email.me; posting-host="e9d42356b81d42d02d68289eca9ecab3"; logging-data="2544429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hjbfVLhxaOsPAi7qdld1X3mQe/peqS4o=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:1cqMNSZ5Cl3SBTvdrRiorF51Ta0= Content-Language: en-GB In-Reply-To: <87r05c4x2c.fsf@bsb.me.uk> Bytes: 1965 On 09/01/2025 02:04, Ben Bacarisse wrote: > Julio Di Egidio <julio@diegidio.name> writes: <snip> >> My idea (but I would think this is pretty "canonical" and, if it isn't, I >> am missing the mark) is: my public functions take/give "sealed" instances >> (with const members to const data), as the user is not supposed to directly >> manipulate/edit the data, OTOH of course my implementation is all about >> in-place editing... > > See Tim's reply -- the best way to implement "sealed" instances is to > use an opaque type where the "user code" simply can't see anything but a > pointer to an otherwise unknown struct. You say "best", I'd prefer "canonical" meaning what the people do who know what they are doing. :) But OK, that sounds indeed reasonable: I'll see what I get... -Julio