std::vector<> problem...

Hi,
I have the following code:
1
2
3
4
5
6
7
8
9
std::vector<ResourceIF> BAR::getResources(Wrapper *wrapper)
{
      std::vector<ResourceIF*> eligibleResources;
      std::vector<ResourceIF*> availableResources;
      availableResources = wrapper->getResources();  // returns std::vector<ResourceIF*>

      eligibleResources = this->resourceEligibilityRoot->selectResources(availableResources);
      return eligibleResources;
}


The signature of selectResources is:
 
virtual std::vector<void *> selectResources(std::vector<void *> resources) = 0;


When I try to compile, I get the following:

No matching function for call to ‘::selectResources(vector<ResourceIF , allocator<ResourceIF > &>)’
Candidates are: class vector<void *, allocator<void *>> RERIF::selectResources(vector<void *, allocator<void *> >)


Why does selectResources() not want to play along when I pass a vector of ResourceIF*'s into it? I thought by using vector<void*> in selectResources() param list- it would allow me to pass into it a vector of any type... Any ideas on what I'm doing wrong here?
I thought by using vector<void*> in selectResources() param list- it would allow me to pass into it a vector of any type

No, that will not work. std::vector<ResourceIF*> and std::vector<void*> is two separate types and there is no build in operations to assign one of them to the other
Topic archived. No new replies allowed.