mirror of
https://github.com/boostorg/logic.git
synced 2025-07-29 19:57:17 +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 ;
|
||||
import boostbook ;
|
||||
import doxygen ;
|
||||
|
@ -138,6 +138,18 @@ if (<functionname>indeterminate</functionname>(x)) {
|
||||
else {
|
||||
// report success or failure of x
|
||||
}</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>
|
||||
|
@ -130,6 +130,8 @@ int test_main(int, char*[])
|
||||
// Clang compiles well.
|
||||
//
|
||||
// constexpr bool res_safe_bool = tribool(true); // false
|
||||
// constexpr tribool xxx = (tribool(true) || tribool(indeterminate));
|
||||
// static_assert(xxx, "Must be true!");
|
||||
#endif
|
||||
|
||||
std::cout << "no errors detected\n";
|
||||
|
Reference in New Issue
Block a user