mirror of
https://github.com/boostorg/logic.git
synced 2025-07-30 04:07:15 +02:00
Docs update
This commit is contained in:
@ -1,3 +1,13 @@
|
|||||||
|
# Tribool library
|
||||||
|
|
||||||
|
# Copyright (C) 2002-2003 Douglas Gregor
|
||||||
|
|
||||||
|
# Use, modification and distribution is subject to the Boost Software License,
|
||||||
|
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
# For more information, see http://www.boost.org/
|
||||||
|
|
||||||
project boost-sandbox/utility/doc ;
|
project boost-sandbox/utility/doc ;
|
||||||
import boostbook ;
|
import boostbook ;
|
||||||
import doxygen ;
|
import doxygen ;
|
||||||
|
@ -138,6 +138,18 @@ if (<functionname>indeterminate</functionname>(x)) {
|
|||||||
else {
|
else {
|
||||||
// report success or failure of x
|
// report success or failure of x
|
||||||
}</programlisting>
|
}</programlisting>
|
||||||
|
|
||||||
|
<para> All the logical operators and methods of <code><classname>tribool</classname></code> are marked
|
||||||
|
as <code>constexpr</code> in C++11. It means that <code><classname>tribool</classname></code> can
|
||||||
|
be used in compile time expressions:</para>
|
||||||
|
|
||||||
|
<programlisting>constexpr <classname>tribool</classname> x = (tribool(true) || tribool(indeterminate));
|
||||||
|
<functionname>static_assert</functionname>(x, "Must be true!");
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
|
<note>Some compilers may have troubles with evaluating <code>tribool::operator safe_bool()</code> at compile time.</note>
|
||||||
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
@ -130,6 +130,8 @@ int test_main(int, char*[])
|
|||||||
// Clang compiles well.
|
// Clang compiles well.
|
||||||
//
|
//
|
||||||
// constexpr bool res_safe_bool = tribool(true); // false
|
// constexpr bool res_safe_bool = tribool(true); // false
|
||||||
|
// constexpr tribool xxx = (tribool(true) || tribool(indeterminate));
|
||||||
|
// static_assert(xxx, "Must be true!");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::cout << "no errors detected\n";
|
std::cout << "no errors detected\n";
|
||||||
|
Reference in New Issue
Block a user