4 ms·
Taking bets on when ISO C will acquire a form of templates, or taking it in even more generic direction - parametrized namespaces. Something like this (an illus
by latitude 15y ago
Taking bets on when ISO C will acquire a form of templates, or taking it in even more generic direction - parametrized namespaces. Something like this (an illustrative example, don't knock me down for including val into list):
namespace(T)
{
struct list
{
T val;
list * next;
list * prev;
};
void append(list * l, list * i)
{
...
}
}
Then
list<int> * foo, * bar;
...
append(foo, bar);
No need for namespace nesting, default arguments and other ++isms. Just something to replace multi-line macro blocks.
- deleted 15y ago[deleted]
- koenigdavidmj 15y agoWhy not just use C++ without namespace nesting, default arguments, and other ++isms?