Re: GHashTable and const



On Thu, 2008-07-03 at 14:21 +0300, Andrew W. Nosenko wrote:
> On Thu, Jul 3, 2008 at 2:11 PM, Rui Tiago Cação Matos
> <tiagomatos gmail com> wrote:
> > On 03/07/2008, Alberto Mardegan <mardy users sourceforge net> wrote:
> >> Hi, quick question: why do methods like
> >>
> >>  g_hash_table_size()
> >>  g_hash_table_lookup()
> >>
> >>  don't accept a "_const_ GHashTable *" as first parameter?
> >
> > Since GHashTable is an opaque data type you don't have to worry about it.
> 
> Excuse me, but whether some type/structure is opaque or not have
> nothing with constness.  It just irrelewant.  And yes, I'm also very
> tired by hevy constless of Glib's API :-(

Because const in C is crippled, unlike in C++ where its actually useful.

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

Attachment: signature.asc
Description: This is a digitally signed message part



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