I've got a custom class that I've defined, called User.cpp:
#include <iostream>
#include <set>
#include <utility>
using namespace std;
/////////////////////////////////////////////////////////////
//  Custom comparator for set of movie ratings
//
//  Stores user ratings in a tree, where highest rating
//  is at root of the tree.
/////////////////////////////////////////////////////////////
struct Cmp {
    bool operator ()(const pair<size_t,size_t> &a, const pair<size_t,size_t> &b) {
        return a.second > b.second;
    }
};
/////////////////////////////////////////////////////////////
//  User container class
/////////////////////////////////////////////////////////////
class User { 
    private: 
        const size_t userIndex;
        set<pair<size_t,size_t>, Cmp> ratings;
    public:
        /*
            Constructor
        */
        explicit User(const size_t userIndex) 
            : userIndex(userIndex)
        { }
};
I hope you can see where I am going with this. I now want to store all of these User objects into a new object defined by another class UserBase.cpp -- a container for the User objects if you will.
#include <iostream>
#include <set>
#include <utility>
using namespace std;
/////////////////////////////////////////////////////////////
//  UserBase container class
/////////////////////////////////////////////////////////////
class UserBase { 
    private: 
        set<User> cont;
    public:
};
But this gives errors like this:
UserBase.cpp:32:7: error: ‘User’ was not declared in this scope
   set<User> cont;
       ^
UserBase.cpp:32:11: error: template argument 1 is invalid
   set<User> cont;
           ^
UserBase.cpp:32:11: error: template argument 2 is invalid
UserBase.cpp:32:11: error: template argument 3 is invalid
I was wondering what I need to do to make this work. Is it something with templates?
 
     
    