You can't. Your container is invalid because its element type must be copy-assignable or move-assignable, and yours is neither. This isn't diagnosed at construction, but you've already seen the resulting compilation error that occurs when you try to perform operations that rely on this property.
You could make it legal and compilable by overloading the copy and move assignment operators of your element type to ignore the const
member, but it's not clear that this would make any sense.
Either store std::unique_ptr
s to dynamically-allocated objects, or rethink the model.