[Qt-creator] Syntax highlighting, template templates
Nico Kruber
kruber at zib.de
Mon Jul 6 13:22:03 CEST 2009
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090706/8233733c/attachment.bin
More information about the Qt-creator-old
mailing list