I have 2 questions.
does any one know what an hpp file is? Why would someone do that?
I am trying to implement a class that extends vector
But I want to use all the original functions and add on actions for each function. So I wrote:
#include <iostream>
#include <vector>
#ifndef _MY_PERSONAL_VECTOR
#define _MY_PERSONAL_VECTOR
class PersonalVec: public std::vector<int>{
public:
PersonalVec();
void push_back(const int& Val);
};
#endif
and in the cpp file:
#include <iostream>
#include "PersonalVec.hpp"
using namespace std;
PersonalVec::PersonalVec(): std::vector<int>(){
}
void PersonalVec::push_back(const int& Val):vector<int>::push_back(Val){
cout<<"new improved vector";
}
So in the function push_back I am trying to call the vector push_back but it is not working.
Anyone has any idea?