J
jacob navia
Hi
I am writing a container library in C, and I wonder how some operations
are done in C++. For instance, for a given container I have a function
called "Apply" that will call a function passing it each element of the
container in turn.
int (*Apply)(List l,int (Applyfn)(void *,void *),void *arg);
the "arg" argument is passed through to the "Applyfn" function.
When looking at the C++ documentation of the list container I find no
straight equivalent even if this operation could be done with an
iterator or another construct.
Another "missing" feature is the "Contains" method of C# list class:
finding whether an element is in the list.
The "Copy" operation will make a (shallow) copy of a given list. Java
and C# have a method for this but not C++
I am doing a "Notes" section to the documentation where I document the
solutions provided by other languages.
Thanks in advance for your attention.
jacob
I am writing a container library in C, and I wonder how some operations
are done in C++. For instance, for a given container I have a function
called "Apply" that will call a function passing it each element of the
container in turn.
int (*Apply)(List l,int (Applyfn)(void *,void *),void *arg);
the "arg" argument is passed through to the "Applyfn" function.
When looking at the C++ documentation of the list container I find no
straight equivalent even if this operation could be done with an
iterator or another construct.
Another "missing" feature is the "Contains" method of C# list class:
finding whether an element is in the list.
The "Copy" operation will make a (shallow) copy of a given list. Java
and C# have a method for this but not C++
I am doing a "Notes" section to the documentation where I document the
solutions provided by other languages.
Thanks in advance for your attention.
jacob