[Interest] QDatastream, QMap, QImage serialization
Thiago Macieira
thiago.macieira at intel.com
Mon May 21 22:02:28 CEST 2018
On Monday, 21 May 2018 15:50:02 -03 Jason H wrote:
> I don't think C++ has a good concept of what it is that I want to do. C++
> does not allow multiple return types from functions, therefore, the only
> way to get the type you want returned is provide an overload with different
> parameters. What is needed is something "orthogonal" to an enum. Whereas
> enums are all the same type, you need a thing that is the same "thing" but
> different type. You can't use enums names because it's too easy to convert
> between them since they are all ints under the hood.
>
> class QPixmapAtom {};
> class QImageAtom {};
> class QBrush {
> ...
> QPixmap texture(QPixmapAtom());
> QImage texture(QImageAtom());
> };
How about just using different function names instead? Like, you know,
"texture" and "textureImage"?
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Interest
mailing list