Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56839 - in trunk: boost/spirit/include libs/spirit/test/karma
From: hartmut.kaiser_at_[hidden]
Date: 2009-10-14 14:45:59


Author: hkaiser
Date: 2009-10-14 14:45:59 EDT (Wed, 14 Oct 2009)
New Revision: 56839
URL: http://svn.boost.org/trac/boost/changeset/56839

Log:
Spirit: removing remnants of safe_bool
Removed:
   trunk/boost/spirit/include/support_safe_bool.hpp
Text files modified:
   trunk/libs/spirit/test/karma/bool.cpp | 13 ++++++-------
   1 files changed, 6 insertions(+), 7 deletions(-)

Deleted: trunk/boost/spirit/include/support_safe_bool.hpp
==============================================================================
--- trunk/boost/spirit/include/support_safe_bool.hpp 2009-10-14 14:45:59 EDT (Wed, 14 Oct 2009)
+++ (empty file)
@@ -1,18 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2009 Joel de Guzman
- Copyright (c) 2001-2009 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under 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)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_INCLUDE_SUPPORT_SAFE_BOOL
-#define BOOST_SPIRIT_INCLUDE_SUPPORT_SAFE_BOOL
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#include <boost/spirit/home/support/safe_bool.hpp>
-
-#endif

Modified: trunk/libs/spirit/test/karma/bool.cpp
==============================================================================
--- trunk/libs/spirit/test/karma/bool.cpp (original)
+++ trunk/libs/spirit/test/karma/bool.cpp 2009-10-14 14:45:59 EDT (Wed, 14 Oct 2009)
@@ -14,8 +14,6 @@
 #include <boost/spirit/include/karma_directive.hpp>
 #include <boost/spirit/include/karma_phoenix_attributes.hpp>
 
-#include <boost/spirit/home/support/safe_bool.hpp>
-
 #include <boost/spirit/include/phoenix_core.hpp>
 #include <boost/spirit/include/phoenix_operator.hpp>
 #include <boost/spirit/include/phoenix_statement.hpp>
@@ -47,11 +45,12 @@
     bool b;
 
     // we need to provide (safe) convertibility to bool
- typedef boost::spirit::safe_bool<test_bool_data> safe_bool_type;
- operator safe_bool_type::result_type() const
- {
- return safe_bool_type()(b);
- }
+private:
+ struct dummy { void true_() {}; };
+ typedef void (dummy::*safe_bool)();
+
+public:
+ operator safe_bool () const { return b ? &dummy::true_ : 0; }
 };
 
 struct test_bool_policy : boost::spirit::karma::bool_policies<>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk