I am creating a C ++ library (mainly for fun) that I have been working on for some time (years, haha, it's just a hobby)
I recently switched some reinforcements (reading, library dependency) to another library. Unfortunately, the library mentioned is not related to const-correctness at all. I'm a bit of an OCD and I like to challenge myself to do things the βRight Wayβ, so I want my library to be const-correct. I started this several times, and some parts; I know that it is better to start const-correct from the very beginning, but this is not very relevant or for discussion. The fact is that I am interested in giving it a serious continuation, but another library prevents me from doing this.
You know, you can ask?
Well, if I call a method that explicitly needs to be const (actually doesn't change anything), and my method is also a candidate for consting (new word), I cannot provide constness on my method until this other method also const .
Example:
This is only apparent from empirical evidence and from my research and understanding of constness. However, this may be a falsely shaped understanding, so I am open (and hope?) So that it is incorrect and shows differently (although this would shake the basis of my understanding of the consistency haha)
What poor soul should do if he (or she) wants to write the right library, but the dependency is not written that way?
Hope this is a suitable question for SO. Please (I'm sure you will do this) let me know if this is not the case, or if there is a better StackExchange site to publish it.
PS I found this SO question , but I was hoping that a theme / solution could be developed.
c ++
Volte
source share