1.让自己习惯c++
Last updated
Last updated
(a + b) = cclass TextBlock{
public:
...
const char& operator[](std::size_t position) const{
...
return text[position];
}
char& operator[](std::size_t position){
return
const_cast<char&>(
static_cast<const TextBlock>(*this)
[position]
);
}
...
};