Re: GHashTable and const



On Thu, Jul 3, 2008 at 5:50 PM, Havoc Pennington <hp pobox com> wrote:
> Hi,
>
> On Thu, Jul 3, 2008 at 9:49 AM, Alberto Mardegan
> <mardy users sourceforge net> wrote:
>> If I proposed a patch which adds some "const" here and there, would that be
>> discarded a priori, or would it undergo a serious consideration?
>>
>
> I'm not a GTK maintainer, but one problem with this is backward
> compatibility. Adding const can certainly break previously-working
> code, especially C++ code.
>

Sorry for long delay, but could you please explain, how changing from
    g_hash_table_size (GHashTable *hash_table);
to
    g_hash_table_size (const GHashTable *hash_table);
would to break any C++ code?  It would to make some bunch of
const_cast<> unneeded and noop -- yes.  But break...  hard to imagine.

Plase, pay attention that I say about (1) functions that don't modify
object's state, and (2) receive "just pointer", not ther
pointer-to-pointer.

-- 
Andrew W. Nosenko <andrew w nosenko gmail com>


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