Q:

How do I move a vector of objects that contain a unique_ptr as a member? 

I have a function that returns an std::vector of a class that contains a std::unique_ptr as member.  I need to store this vector object on the heap so I can pass it through a C-style DLL interface. 
See the following code sample:

#include <iostream>
#include <cstdlib>
#include <memory>
#include <vector>

// I have control over the following two classes
class SomeBigClassWithManyMembers { };

class MyClass
{
    std::unique_ptr<SomeBigClassWithManyMembers> up;

public:
    static const std::vector<MyClass> GetMany()
    {
        // imagine this does lots of work
        return std::vector<MyClass>(50);
    }

    // following code is suggested in https://stackoverflow.com/questions/31430533/move-assignable-class-containing-vectorunique-ptrt but doesn't help
    /*
    MyClass() { }
    MyClass(MyClass&& other): up{std::move(other.up)} { }
    MyClass& operator=(MyClass&& other)
    {
        up = std::move(other.up);
        return *this;
    }
    */
};

// Imagine that I can't change this C-style code - it's a fixed interface provided by someone else
struct NastyCStyleStruct
{
    void* v;
};
void NastyCStyleInterface(NastyCStyleStruct s) { printf("%u", (unsigned int)((std::vector<MyClass>*)s.v)->size()); }

int main()
{
    NastyCStyleStruct s;
    s.v = new std::vector<MyClass>(std::move(MyClass::GetMany()));
    NastyCStyleInterface(s);
    return 0;
}

Note that in my actual code, the vector needs to outlive the function in which it is created (because this is being done in a DLL), so writing
auto vec = MyClass::GetMany();
s.v = &vec;

would not suffice.  The vector must be stored on the heap. 
The trouble here is that the code seems to try to use the (non-existent) copy constructor of MyClass.  I can't understand why the copy constructor is being invoked, because I am explicitly asking for move semantics with std::move.  Not even initialising s.v to a fresh new std::vector of the appropriate size and calling the three-argument version of std::move works. 
Errors from g++:
In file included from /usr/include/c++/7/memory:64:0,
                 from stackq.cpp:4:
/usr/include/c++/7/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_T1*, _Args&& ...) [with _T1 = MyClass; _Args = {const MyClass&}]’:
/usr/include/c++/7/bits/stl_uninitialized.h:83:18:   required from ‘static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const MyClass*, std::vector<MyClass> >; _ForwardIterator = MyClass*; bool _TrivialValueTypes = false]’
/usr/include/c++/7/bits/stl_uninitialized.h:134:15:   required from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const MyClass*, std::vector<MyClass> >; _ForwardIterator = MyClass*]’
/usr/include/c++/7/bits/stl_uninitialized.h:289:37:   required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const MyClass*, std::vector<MyClass> >; _ForwardIterator = MyClass*; _Tp = MyClass]’
/usr/include/c++/7/bits/stl_vector.h:331:31:   required from ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = MyClass; _Alloc = std::allocator<MyClass>]’
stackq.cpp:43:65:   required from here
/usr/include/c++/7/bits/stl_construct.h:75:7: error: use of deleted function ‘MyClass::MyClass(const MyClass&)’
     { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stackq.cpp:10:7: note: ‘MyClass::MyClass(const MyClass&)’ is implicitly deleted because the default definition would be ill-formed:
 class MyClass
       ^~~~~~~
stackq.cpp:10:7: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = SomeBigClassWithManyMembers; _Dp = std::default_delete<SomeBigClassWithManyMembers>]’
In file included from /usr/include/c++/7/memory:80:0,
                 from stackq.cpp:4:
/usr/include/c++/7/bits/unique_ptr.h:388:7: note: declared here
       unique_ptr(const unique_ptr&) = delete;
       ^~~~~~~~~~

How can I repair this code so that the vector object itself is stored on the heap? 

A:

The problem here is that GetMany is defined to return a const std::vector.  Even though it's returning by value, so there's no risk of unwanted side-effects if you mutate the result, the compiler still enforces the type (auto just copied the exact return type of the function after all), making it impossible to move from it.  So instead of cheaply copying a few pointer/size_t-sized values (to the vector contents, size and capacity), it had to do a full copy construction, including copy constructing all the values stored in the original vector.  That fails due to the unique_ptr member in the stored instances. 
Simply dropping the const from the return type should allow std::move/vector's move constructor to do their job, allowing the ultra-cheap extraction of the contents of the vector returned by GetMany with no copies (or even moves) of any instance of MyClass.