prbool.rst (558B)
1 PRBool 2 ====== 3 4 Boolean value. 5 6 7 Syntax 8 ~~~~~~ 9 10 .. code:: 11 12 #include <prtypes.h> 13 14 typedef enum { PR_FALSE = 0, PR_TRUE = 1 } PRBool; 15 16 17 Description 18 ~~~~~~~~~~~ 19 20 Wherever possible, do not use PRBool in Mozilla C++ code. Use standard 21 C++ ``bool`` instead. 22 23 Otherwise, use :ref:`PRBool` for variables and parameter types. Use 24 ``PR_FALSE`` and ``PR_TRUE`` for clarity of target type in assignments 25 and actual arguments. Use ``if (bool)``, ``while (!bool)``, 26 ``(bool) ? x : y``, and so on to test Boolean values, just as you would 27 C ``int``-valued conditions.