[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gl_list API

From: Marc Nieper-Wißkirchen
Subject: Re: gl_list API
Date: Tue, 6 Apr 2021 23:09:54 +0200

Am Di., 6. Apr. 2021 um 23:04 Uhr schrieb Bruno Haible <bruno@clisp.org>:
> > But when designing a general utility, for all kinds of programs to use,
> > it is inappropriate to say "storing null elements is not useful".
> I'm afraid we'll have to disagree here.

In some of my uses of the gl_list module, the element is in fact a small
integer, cast to an 'uintptr_t' and then further cast to a 'const void *'.
If the API would forbid storing a NULL pointer, my specialized container
type would need a workaround for storing the integer value 0.

NULL can also be a sensible value for "holes" in the list showing up in algorithms that need to lazily remove elements (e.g. the list will only be eventually compactified).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]