c++ - On platforms where pthread_t is numeric, is 0 guaranteed to be an invalid value? -


this question has answer here:

pthread_t (as returned pthread_self()) opaque type, on platforms numeric, example typedefed unsigned long. on these platforms, 0 invalid pthread_t value? -1?

if wanted value either pthread_t or invalid, i'd use boost::optional<pthread_t> or std::optional<pthread_t> c++1y.

this has little overhead (bytes), expresses want (this value may or may not pthread_t), , doesn't rely on platform-specific behavior.


Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

R - Plot: How to format in 10-base scientific notation and put it text, mtex, title etc functions? -

validation - How to pass paramaters like unix into windows batch file -