QUOTE
../../pfc/list.h(208) : error C2440: 'initializing' : cannot convert from 'void *const ' to 'void *& '
I recieved the above error message when compiling the SDK with my component code.
This is the function, and the specific line, having trouble:
QUOTE
bool bsearch_range(int (__cdecl *compare )(T elem1, T elem2 ),T item,int * index,int * count) const
{
int max = get_count();
int min = 0;
int ptr;
while(min<max)
{
ptr = min + (max-min) / 2;
T& test = buffer[ptr];
int result = compare(test,item);
if (result<0) min = ptr + 1;
else if (result>0) max = ptr;
else
{
int num = 1;
while(ptr>0 && !compare(buffer[ptr-1],item)) {ptr--;num++;}
while(ptr+num<get_count() && !compare(buffer[ptr+num],item)) num++;
if (index) *index = ptr;
if (count) *count = num;
return 1;
}
}
if (index) *index = min;
return 0;
}
{
int max = get_count();
int min = 0;
int ptr;
while(min<max)
{
ptr = min + (max-min) / 2;
T& test = buffer[ptr];
int result = compare(test,item);
if (result<0) min = ptr + 1;
else if (result>0) max = ptr;
else
{
int num = 1;
while(ptr>0 && !compare(buffer[ptr-1],item)) {ptr--;num++;}
while(ptr+num<get_count() && !compare(buffer[ptr+num],item)) num++;
if (index) *index = ptr;
if (count) *count = num;
return 1;
}
}
if (index) *index = min;
return 0;
}
Can anyone help me?