Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: RBendo on September 02, 2009, 08:08:14 pm

Title: Generic function
Post by: RBendo on September 02, 2009, 08:08:14 pm
i'm not english, so i don't speak english very well, i've installed Code::Blocks, and i wrote a small application which use
the functionality of the generic function:

template <class T> double IDENT () { ... }

But, when i compile the source code, the compiler don't recognize the word template.
Is possible that code::blocks don't recognize template functionality? How do I to introduce this in code::blocks

Title: Re: Generic function
Post by: jens on September 02, 2009, 08:29:03 pm
Code__BLocks is the IDE and not the compiler.

Which compiler, OS and version of C::B dou you use ?

What's the exact error-message you get ?

If it's something like
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
you might try to use the template keyword in a c- and not c++-file.

Be aware, that a file with the ending "c" is treated as c-file. If that's the case, rename your file to cpp close C::B and restart it.