BrainStone BrainStone - 1 year ago 136
C++ Question

Eclipse CDT - "Invalid arguments" when using template defaults

I am getting a weird error with the following code:

template<class T, size_t Size = sizeof(T)>
class foobar {

template<class T>
void foo(foobar<T> param1) {
// Do something

void bar() {
foobar<int> obj;


The error occurs at the line
and is:

Invalid arguments '
Candidates are:
void foo(foobar<#0,unsigned int16 0 #0>)

The code itself compiles fine however. I have no idea how to fix it.

Eclipse giving me Invalid arguments ' Candidates are: void * memset(void *, int, ?) ' though I know the args are good did not fix it, so this question is not a duplicate.

Answer Source

This is a bug in CDT. A bug report has been filed to track it, and a patch that fixes it has been posted.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download