[Development] Should qMetaTypeId<const T>() == qMetaTypeId<T>() ?

Thiago Macieira thiago.macieira at intel.com
Wed Aug 24 16:05:40 CEST 2016


On quarta-feira, 24 de agosto de 2016 15:23:01 PDT Marc Mutz wrote:
> Hi,
> 
> Currently, it's not, which doesn't make much sense, does it?

No, but const types can't be registered as metatypes either. Shouldn't the 
caller drop the const qualifier on its own?

>   template <typename T>
>   int qMetyTypeId<T>() {
>     return qMetaTypeIdHelper<typename std::remove_cv<T>::type>();
>   }
> 
> ?
> 
> (There's of course a lot more involved in this, registration should discard
> const, too, e.g.).

Registration of const should be ill-formed.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list