Re: [Libclc-developers] An alternative clc_list approach + an iterator.
Status: Planning
Brought to you by:
augestad
|
From: Hallvard B F. <h.b...@us...> - 2003-03-25 17:29:50
|
Bj=F8rn Augestad writes: > Attached is a file containing a list adt as well as an iterator adt. clc_stl.h says: typedef struct clc_list_tag* clc_list; typedef struct clc_iterator_tag* clc_iterator; I think typedefs to pointers like this is a bad idea. It makes calls to functions like these: int clc_list_push_back(clc_list lst, void* data); look like they are sending a list argument which is only read by the function, while the function is actually updating through the 'hidden' pointer. I'd rather see typedef struct clc_list_tag clc_list; typedef struct clc_iterator_tag clc_iterator; and int clc_list_push_back(clc_list *lst, void* data); --=20 Hallvard |