(This is the result of breaking down the steps. Originally the function was defined with one line: "return allPtrs[ptr].created();" but I broke it down to help me find the problem. I'm still stuck - I have no idea where the operator+ has anything to do with this...any help is appreciated. Thanks.

04-16-2003

Magos

I believe that the [ ] operator works so it takes the base pointer (allPtrs) then adds the relative adress (ptr) to get the effective adress. And thus, const void* doesn't have a + operator defined.
Why doing that? Indexes must be integers.

04-16-2003

roktsyntst

allPtrs is not an array, but rather a std::map with first type "void *". It's subscript operator should be overloaded to take that type and return the associated Object (in this case). What puzzles me is this error ocurring here, but other functions using a similar construct do not report an error.

I also forgot to mention that the end of that function reports the following warning:W8057: Parameter 'ptr' is never used in function Mgr::allocated(const void* const).

This is also strange, since ptr is clearing being used...I'm guessing there's an obvious syntax error that I'm just missing.

04-16-2003

Stoned_Coder

const void *

do you know what that is?

do you mean

void * const

04-16-2003

roktsyntst

The difference refers to whether it is the address that is constant or the value there, correct? It probably makes more sense to have void * const, but that doesn't change the issue. A search on comp.lang.c++ (http://groups.google.com/groups?hl=e...5506%40acm.org) revealed that you can't use operator[] on a const map (which is a map that is part of a const object). So I used find instead (at the recommendation there), but that said it could find no match. So I've kept the const-ness of the pointer out completely in order for it to compile...

edit: I changed const void* to void* and now to void * const, and it seems to be working. Thanks for the tip.