QVariant::Private: select storage in get at compile time
Change-Id: I82b0a7ec28400dac64ea785ba6766ca488e615aa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
3f9d19b17b
commit
388e7504be
@ -499,7 +499,7 @@ public:
|
||||
// determine internal storage at compile time
|
||||
template<typename T>
|
||||
const T &get() const
|
||||
{ return *static_cast<const T *>(storage()); }
|
||||
{ return *static_cast<const T *>(CanUseInternalSpace<T> ? &data.data : data.shared->data()); }
|
||||
template<typename T>
|
||||
void set(const T &t)
|
||||
{ *static_cast<T *>(CanUseInternalSpace<T> ? &data.data : data.shared->data()) = t; }
|
||||
|
Loading…
Reference in New Issue
Block a user