base: Add const qualifiers to 'util/list.h'

This patch adds support for iterating through a const list. This allows
users of lists to be more rigid with regard to constness. Furthermore,
the patch adds the function 'List::insert_at' for inserting an element
at a specified position. By adding this function, we can remove code
duplication in nitpicker.
This commit is contained in:
Norman Feske
2013-09-07 12:54:35 +02:00
parent 664aff2a56
commit 21462cdbd2
7 changed files with 43 additions and 21 deletions

View File

@ -28,7 +28,7 @@ namespace File_system {
bool has_sub_node_unsynchronized(char const *name) const
{
Node *sub_node = _entries.first();
Node const *sub_node = _entries.first();
for (; sub_node; sub_node = sub_node->next())
if (strcmp(sub_node->name(), name) == 0)
return true;