should help you out I have a struct with some const variables , You are doing an assignment:
hashTable[index] = data;
using InternalHashData = std::pair<HashKey, void*>;
using ExternalHashData = std::pair<const HashKey, void*>;
InternalHashData& something_to_be_returned = ..; // never expose this
return reinterpret_cast<ExternalHashData&>(something_to_be_returned); // this is OK
With these it helps 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.
Assignment operator when there are static, const members?
may help you . The assignment operator copies one object into another. Since all objects of the same type share the same static members, there's no reason to copy the static members. const members are another matter. You can't (well, shouldn't) change them, but if two objects have different values for a const member, it might not be a good idea to copy one object into another; the const member won't have the right value. That's why the compiler doesn't generate a copy assignment operator for classes that have const members. So you first have to be sure that copying such an object makes sense, even with the wrong value for the const members; and then ask yourself why it has const members if they don't affect how it behaves.
To fix the issue you can do The designer of the original class decided that operator=() is not supported and you should not try to implement it. But, I suspect that the reason you want to implement it is because you are using it in another class and you want to implement operator=() for that class.
A b = a;
b = a; // <--- calls operator=()
A* aPtr = &a;
aPtr = &b; // this is ok