Deleted function unique_ptr

You aren’t explicitly following the “rule of three” (or is it five these days?). GCC will attempt to generate a copy constructor of UserQueues since you did not explicitly = delete; the copy constructor. When it does that, it will attempt to copy your std::vector<JobDeque>, but since that contains move-only std::unique_ptr‘s, it will fail to compile. So, the constructors of your UserQueues should look like:

class UserQueues 
{

    public:
        explicit UserQueues();
        UserQueues(const UserQueues&) = delete;
        UserQueues& operator=(const UserQueues&) = delete;
        ~UserQueues() = default;

    [...]

};

To prevent the copy constructors from getting implicitly generated by the compiler. See this related question I asked two years for more info How to declare a vector of unique_ptr’s as class data member?

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)