I have a container of containers which I need to sort by some function I get as a parameter. Here's the header files of the containers :
using namespace std;
template <class Element, class Compare = std::equal_to<Element>>
class UniqueArray {
public:
    Element** data;
    unsigned int curr_size;
    unsigned int max_size;
    int* availability_array;
    explicit UniqueArray(unsigned int size);
    UniqueArray(const UniqueArray& other);
    ~UniqueArray();
//    UniqueArray& operator=(const UniqueArray&) = delete;
    unsigned int insert(const Element& element);
    bool getIndex(const Element& element, unsigned int& index) const;
    const Element* operator[] (const Element& element) const;
    bool remove(const Element& element);
    unsigned int getCount() const;
    unsigned int getSize() const;
    class Filter {
    public:
        virtual bool operator() (const Element&) const = 0;
    };
    UniqueArray filter(const Filter& f) const;
    class UniqueArrayIsFullException{};
    class Iterator{
    public:
        using iterator_category = std::random_access_iterator_tag;
        using value_type = Element;
        using refrence = Element&;
        Iterator(Element** data): data(data){}
        refrence operator*(){
            return **data;
        }
        Iterator& operator++(){
            ++data;
            return *this;
        }
        friend bool operator!=(Iterator it1, Iterator it2){
            return it1.data != it2.data;
        }
    private:
        Element** data;
    };
    Iterator begin(){
        return Iterator(data);
    }
    Iterator end(){
        return Iterator(data + max_size);
    }
};
The second container which containes the previous one :
using namespace ParkingLotUtils;
using std::ostream;
namespace MtmParkingLot {
    class ParkingLot {
    public:
        UniqueArray<Vehicle, Vehicle::compareVehicles> motorbike_parking;
        UniqueArray<Vehicle, Vehicle::compareVehicles> car_parking;
        UniqueArray<Vehicle, Vehicle::compareVehicles> handicapped_parking;
        ParkingLot(unsigned int parkingBlockSizes[]);
        ~ParkingLot() = default;
        ParkingResult enterParking(VehicleType vehicleType, LicensePlate licensePlate, Time entranceTime);
        ParkingResult exitParking(LicensePlate licensePlate, Time exitTime);
        ParkingResult getParkingSpot(LicensePlate licensePlate, ParkingSpot& parkingSpot) const;
        void inspectParkingLot(Time inspectionTime);
        friend ostream& operator<<(ostream& os, const ParkingLot& parkingLot);
        int calculateFee(Time entryTime, Time exitTime, VehicleType type, Vehicle& v);
        int calculateFeeRecursive(Time entryTime, Time exitTime, VehicleType type, int iter, int totalPrice);
        bool isVehicleInLot(LicensePlate licensePlate, VehicleType& type, unsigned int& index);
    };
}
provided an ParkingLot object and a compare function which compares by ParkingSpot which is a Vehicle member variable , how can I sort the whole parking lot at once ? 
Thought of using std::sort but i'm not sure on how to implement this.
EDIT:
Vechile header :
using namespace ParkingLotUtils;
namespace MtmParkingLot {
    class Vehicle {
    public:
        LicensePlate licensePlate;
        Time entryTime;
        VehicleType type;
        ParkingSpot spot;
        bool fine;
        Vehicle(LicensePlate plate, ParkingSpot spot, Time entry_time = 0, VehicleType type = CAR, bool fine = false);
        ~Vehicle() = default;
        Time getEntryTime() const;
        VehicleType getType() const;
        LicensePlate getLicensePlate() const;
        ParkingSpot vehicleGetParkingSpot() const;
        bool isVehicleFined() const;
        class compareVehicles{
        public:
            compareVehicles() = default;
            bool operator() (const Vehicle& v1, const Vehicle& v2){
                return (v1.licensePlate.compare(v2.licensePlate) == 0);
            }
        };
    };
}
ParkingSpot header :
namespace ParkingLotUtils {
    using std::ostream;
    /**
     * @brief Represents a Parking Spot (Block + Number) of a Vehicle.
     * 
     */
    class ParkingSpot {
    public:
        /**
         * @brief Construct a new Parking Spot object
         * 
         * @param parkingBlock The Parking Block of the vehicle (represented by VehicleType enum)
         * @param parkingNumber The number of the parking spot within the block
         */
        ParkingSpot(VehicleType parkingBlock = FIRST, unsigned int parkingNumber = 0);
        /**
         * @brief Get the Parking Block of this ParkingSpot
         * 
         * @return VehicleType The Parking Block (represented by VehicleType enum)
         */
        VehicleType getParkingBlock() const;
        /**
         * @brief Get the Parking Number of this ParkingSpot
         * 
         * @return unsigned int The number of the parking spot within the block
         */
        unsigned int getParkingNumber() const;
        /**
         * @brief Compares given ParkingSpot objects
         * 
         * @param ps1
         * @param ps2 
         * @return true If ps1 < ps2
         * @return false otherwise
         */
        friend bool operator< (const ParkingSpot& ps1, const ParkingSpot& ps2);
        /**
         * @brief Prints given ParkingSpot object
         * 
         * @param os output stream to print into
         * @param parkingSpot ParkingSpot object to print
         * @return ostream& output stream after the print
         */
        friend ostream& operator<< (ostream& os, const ParkingSpot& parkingSpot);
    private:
        enum VehicleType parkingBlock;
        unsigned int parkingNumber;
    };
}
EDIT 3 : Updated the header file for UniqueArray - including iterators
