mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +08:00
Add missing const. (#297)
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
parent
382205c057
commit
cd82fccde7
@ -62,8 +62,8 @@ class Screen {
|
|||||||
void Print();
|
void Print();
|
||||||
|
|
||||||
// Get screen dimensions.
|
// Get screen dimensions.
|
||||||
int dimx() { return dimx_; }
|
int dimx() const { return dimx_; }
|
||||||
int dimy() { return dimy_; }
|
int dimy() const { return dimy_; }
|
||||||
|
|
||||||
// Move the terminal cursor n-lines up with n = dimy().
|
// Move the terminal cursor n-lines up with n = dimy().
|
||||||
std::string ResetPosition(bool clear = false);
|
std::string ResetPosition(bool clear = false);
|
||||||
|
@ -13,9 +13,9 @@ class ConstRef {
|
|||||||
ConstRef() {}
|
ConstRef() {}
|
||||||
ConstRef(T t) : owned_(t) {}
|
ConstRef(T t) : owned_(t) {}
|
||||||
ConstRef(const T* t) : address_(t) {}
|
ConstRef(const T* t) : address_(t) {}
|
||||||
const T& operator*() { return address_ ? *address_ : owned_; }
|
const T& operator*() const { return address_ ? *address_ : owned_; }
|
||||||
const T& operator()() { return address_ ? *address_ : owned_; }
|
const T& operator()() const { return address_ ? *address_ : owned_; }
|
||||||
const T* operator->() { return address_ ? address_ : &owned_; }
|
const T* operator->() const { return address_ ? address_ : &owned_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T owned_;
|
T owned_;
|
||||||
@ -82,8 +82,10 @@ class ConstStringRef {
|
|||||||
ConstStringRef(const wchar_t* ref) : ConstStringRef(std::wstring(ref)) {}
|
ConstStringRef(const wchar_t* ref) : ConstStringRef(std::wstring(ref)) {}
|
||||||
ConstStringRef(const char* ref)
|
ConstStringRef(const char* ref)
|
||||||
: ConstStringRef(to_wstring(std::string(ref))) {}
|
: ConstStringRef(to_wstring(std::string(ref))) {}
|
||||||
const std::string& operator*() { return address_ ? *address_ : owned_; }
|
const std::string& operator*() const { return address_ ? *address_ : owned_; }
|
||||||
const std::string* operator->() { return address_ ? address_ : &owned_; }
|
const std::string* operator->() const {
|
||||||
|
return address_ ? address_ : &owned_;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const std::string owned_;
|
const std::string owned_;
|
||||||
|
Loading…
Reference in New Issue
Block a user