mirror of
https://github.com/boostorg/logic.git
synced 2025-06-25 12:01:33 +02:00
Compare commits
15 Commits
boost-1.49
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
9339be979f | |||
62e9529e09 | |||
6c6cc7dce3 | |||
5aaba307a6 | |||
a582587b22 | |||
246d1ee6df | |||
233cfca75c | |||
44aa483237 | |||
84313760a5 | |||
9df9f3daf6 | |||
24117db3ae | |||
15b34d0bf4 | |||
d1f46c8f98 | |||
23af176127 | |||
196865d37f |
@ -6,4 +6,10 @@ doxygen reference : [ glob ../../../boost/logic/tribool.hpp ]
|
||||
[ glob ../../../boost/logic/tribool_fwd.hpp ]
|
||||
[ glob ../../../boost/logic/tribool_io.hpp ]
|
||||
;
|
||||
boostbook tribool : tribool.boostbook ;
|
||||
boostbook tribool
|
||||
:
|
||||
tribool.boostbook
|
||||
:
|
||||
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
|
||||
<dependency>reference
|
||||
;
|
||||
|
@ -2,7 +2,7 @@
|
||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
|
||||
<library name="Tribool" dirname="logic" id="tribool"
|
||||
last-revision="$Date: 2004/07/25 03:01:38 $" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
last-revision="$Date: 2007/05/03 03:28:53 $" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<libraryinfo>
|
||||
<author>
|
||||
<firstname>Douglas</firstname>
|
||||
@ -197,7 +197,7 @@ cout << boolalpha << x << endl; // Prints "maybe"</programlist
|
||||
|
||||
</section>
|
||||
|
||||
<xi:include href="reference.boostbook"/>
|
||||
<xi:include href="reference.xml"/>
|
||||
|
||||
<testsuite id="tribool.tests">
|
||||
<run-test filename="tribool_test.cpp">
|
||||
|
@ -93,7 +93,7 @@ public:
|
||||
*
|
||||
* \throws nothrow
|
||||
*/
|
||||
tribool(bool value) : value(value? true_value : false_value) {}
|
||||
tribool(bool initial_value) : value(initial_value? true_value : false_value) {}
|
||||
|
||||
/**
|
||||
* Construct a new 3-state boolean value with an indeterminate value.
|
||||
@ -336,7 +336,7 @@ inline tribool operator==(tribool x, tribool y)
|
||||
if (indeterminate(x) || indeterminate(y))
|
||||
return indeterminate;
|
||||
else
|
||||
return x && y || !x && !y;
|
||||
return (x && y) || (!x && !y);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -399,7 +399,7 @@ inline tribool operator!=(tribool x, tribool y)
|
||||
if (indeterminate(x) || indeterminate(y))
|
||||
return indeterminate;
|
||||
else
|
||||
return !(x && y || !x && !y);
|
||||
return !((x && y) || (!x && !y));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -452,7 +452,7 @@ namespace boost {
|
||||
#define BOOST_TRIBOOL_THIRD_STATE(Name) \
|
||||
inline bool \
|
||||
Name(boost::logic::tribool x, \
|
||||
boost::logic::detail::indeterminate_t dummy = \
|
||||
boost::logic::detail::indeterminate_t = \
|
||||
boost::logic::detail::indeterminate_t()) \
|
||||
{ return x.value == boost::logic::tribool::indeterminate_value; }
|
||||
|
||||
|
@ -140,7 +140,8 @@ public:
|
||||
indeterminate_name() : name_(get_default_indeterminate_name<CharT>()) {}
|
||||
|
||||
/// Construct the facet with the given name for the indeterminate value
|
||||
explicit indeterminate_name(const string_type& name) : name_(name) {}
|
||||
explicit indeterminate_name(const string_type& initial_name)
|
||||
: name_(initial_name) {}
|
||||
|
||||
/// Returns the name for the indeterminate value
|
||||
string_type name() const { return name_; }
|
||||
|
35
test/Jamfile
35
test/Jamfile
@ -1,35 +0,0 @@
|
||||
# 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/
|
||||
|
||||
|
||||
# Testing Jamfile autogenerated from XML source
|
||||
subproject libs/logic/test ;
|
||||
|
||||
# bring in rules for testing
|
||||
SEARCH on testing.jam = $(BOOST_BUILD_PATH) ;
|
||||
include testing.jam ;
|
||||
|
||||
# Make tests run by default.
|
||||
DEPENDS all : test ;
|
||||
|
||||
{
|
||||
# look in BOOST_ROOT for sources first, just in this Jamfile
|
||||
local SEARCH_SOURCE = $(BOOST_ROOT) $(SEARCH_SOURCE) ;
|
||||
|
||||
test-suite logic
|
||||
:
|
||||
[ run libs/logic/test/tribool_test.cpp : : : : ]
|
||||
|
||||
[ run libs/logic/test/tribool_rename_test.cpp : : : : ]
|
||||
|
||||
[ run libs/logic/test/tribool_io_test.cpp : : : : ]
|
||||
;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <ios> // for std::boolalpha
|
||||
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
# include <locale>
|
||||
|
Reference in New Issue
Block a user