How to push_back() to a C++ std::vector without using operator=() for which the default definition violates having const members?
struct Item {
Item(int va
For std::vector the elements are required to be Assignable. You type is not Assignable. An implementation of. std::vector could avoid insisting on this requirement but this would be a disservice as the resulting code wouldn't be portable.
You can use a std::list instead or change the definition of you type. For example you can create an accessor to only read the value but no setter. Of course, assignment would change the value. The choice thus is to either allow this change or allow putting the objects into a container. You won't get both.