{def $max = $node.object.data_map.topics.content|count()|dec}
Number of elements: {$max}
{for 0 to $max as $counter} {$node.object.data_map.topics.class_content.options[$node.object.data_map.topics.value[$counter]].name},
{/for}
If it doesn't do the trick, check out the value of {$max}. Is it correct?