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



_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to