X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fhandle.h;h=6140e116d74fb497d83085d921e11b515084616a;hp=be2097e7f248d042c95312185ec40a25e3dca55b;hb=HEAD;hpb=c8bf2d6c15893ccc9dbc4e04611b7229029f4808 diff --git a/source/io/handle.h b/source/io/handle.h index be2097e..06c2034 100644 --- a/source/io/handle.h +++ b/source/io/handle.h @@ -2,17 +2,18 @@ #define MSP_IO_HANDLE_H_ #include +#include namespace Msp { namespace IO { -class Handle +class MSPCORE_API Handle { public: struct Private; private: - Private *priv; + Private *priv = nullptr; public: Handle(); @@ -23,10 +24,7 @@ public: Private &operator*() { return *priv; } const Private &operator*() const { return *priv; } - /** This is effectively a boolean conversion, but avoids accidental - conversion to OS native handles. Unix-based systems use int and win32 uses - void *; const void * is not implicitly convertible to either. */ - operator const void *() const; + explicit operator bool() const; };