I've been working with template templates and there are still some bugs in Qt Creator's syntax highlighter which highlights my code suggesting it has errors (snapshot from 01/07/2009):
--------------------
template< template< typename > class Container, typename ElementType >
bool printSimulations(Container<Element> container){
}
--> "'Container<Element>' is not a type name"
--------------------
template< template< typename > class Container, typename ElementType >
bool printSimulations(Container<Element> container);
--> strangely this doesn't show any error
--------------------
template< template< typename > class Container, typename ElementType >
bool printSimulations(Container<Element> container, const QString& path);
--> "'Container<Element>' is not a type name"
(adding an additional "typename" before Container works with the syntax
highlighter, but not with g++ - QtCreator could instead complain about that ;)
)
--------------------
template< template< typename > class Container, typename ElementType >
bool printSimulations(Container<Element> container, const QString& path) {
typename Container<Element>::const_iterator i = container.constBegin();
const typename Container<Element>::const_iterator end =
container.constEnd();
while(i != end) {
// do something
++i;
}
}
--> "'Container<Element>' is not a type name" at the function declaration
--> and "'Container is not a namespace or class name" shown at the
const_iterator lines
--------------------
Cheers,
Nico Kruber
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Qt-creator mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-creator
