/*
* =====================================================================================
*
* Filename: tribool.cpp
*
* Description: test boost tribool
*
* Version: 1.0
* Created: 10/01/2009 07:33:17 PM
* Revision: none
* Compiler: gcc
*
* Author: rare
* Company:
*
* =====================================================================================
*/
#include <iostream>
#include <boost/logic/tribool.hpp>
#include <boost/foreach.hpp>
void print(boost::tribool b)
{
if (b)
{
std::cout<< "b is true" << std::endl;
}
else if (!b)
{
std::cout << "b is false" << std::endl;
}
else
{
std::cout << "b is indeterminate" << std::endl;
}
}
int main()
{
boost::tribool tbs[3] = {true, false, boost::indeterminate};
BOOST_FOREACH(boost::tribool b, tbs)
{
print(b);
}
}
//output
b is true
b is false
b is indeterminate