Add ref for sliders. (#457)

This resolves:
https://github.com/ArthurSonzogni/FTXUI/issues/456
This commit is contained in:
Arthur Sonzogni
2022-08-13 16:26:53 +02:00
committed by GitHub
parent f461050759
commit d755356481
4 changed files with 63 additions and 40 deletions

View File

@@ -66,6 +66,9 @@ class ConstStringRef {
ConstStringRef(const wchar_t* ref) : ConstStringRef(std::wstring(ref)) {}
ConstStringRef(const char* ref)
: ConstStringRef(to_wstring(std::string(ref))) {}
const std::string& operator()() const {
return address_ ? *address_ : owned_;
}
const std::string& operator*() const { return address_ ? *address_ : owned_; }
const std::string* operator->() const {
return address_ ? address_ : &owned_;