im trying to call a static method from another class, but when I run it, it returns the following:
PagedArray.cpp:21:37: error: no matching function for call to ‘FileManager::loadPage(int&)’
page = FileManager::loadPage(index);
Here is the code I'm trying to call:
PagedArray.cpp
#include "PagedArray.h"
#include "../Entidades/FileManager.h"
template <typename T>
int* PagedArray<T>::operator[](int index) {
Page<T>* page = nullptr;
for(int i = 0; i < this->pagesQueue->Size(); i++){
if(index == ( *(this->pagesQueue->get(i)->getDato()) )->getLineaActual()){
page = *this->pagesQueue->get(i)->getDato();
}
}
if(page == nullptr){
page = FileManager::loadPage(index);
}
return page->getInfo()->get(index)->getDato();
}
And this is the FileManager class:
filemanager.h
#include "../Estructuras/Page.h"
class FileManager {
public:
FileManager();
template <typename T>
static Page<T>* loadPage(int index);
};
FileManager.cpp
#include "FileManager.h"
FileManager::FileManager(){}
template <typename T>
Page<T>* FileManager::loadPage(int index) {
Page<T>* page = nullptr;
return page ;
}
The body in the loadPage method is just to make a test, so it is not very appropriate, I think. Sorry if I missed something, this is my first time, so if you need something else, leave it below
source
share