I am trying to implement the rule of five using the swap idiom.
however, i have internal member fields that are const.
I tried at first to make const_cast, but as I see it probably impossible in this case.
I got into conclusion that the best way will be to turn the member field into ptr to const.
I tried to do this via the initalization list, but cannot find the right syntax. the following doesn't compile:
HashMap::HashMap(double _threshold) : *_ThresholdPtr(_threshold)
I will be grateful to your help, first if ptrs to const are the best way in this case, and how to do it if yes.
thanks!
Aucun commentaire:
Enregistrer un commentaire