Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71230 - trunk/boost/spirit/home/support
From: hartmut.kaiser_at_[hidden]
Date: 2011-04-13 17:53:36


Author: hkaiser
Date: 2011-04-13 17:53:36 EDT (Wed, 13 Apr 2011)
New Revision: 71230
URL: http://svn.boost.org/trac/boost/changeset/71230

Log:
Spirit: adding missing numeric CP specializations for adapted ADTs
Text files modified:
   trunk/boost/spirit/home/support/adapt_adt_attributes.hpp | 35 +++++++++++++++++++++++++++++++++++
   1 files changed, 35 insertions(+), 0 deletions(-)

Modified: trunk/boost/spirit/home/support/adapt_adt_attributes.hpp
==============================================================================
--- trunk/boost/spirit/home/support/adapt_adt_attributes.hpp (original)
+++ trunk/boost/spirit/home/support/adapt_adt_attributes.hpp 2011-04-13 17:53:36 EDT (Wed, 13 Apr 2011)
@@ -155,6 +155,41 @@
             clear(type(val));
         }
     };
+
+ // customization point specializations for numeric generators
+ template <typename T, int N, bool Const>
+ struct absolute_value<fusion::extension::adt_attribute_proxy<T, N, Const> >
+ {
+ typedef typename
+ fusion::extension::adt_attribute_proxy<T, N, Const>::type
+ type;
+
+ static type
+ call (fusion::extension::adt_attribute_proxy<T, N, Const> const& val)
+ {
+ return get_absolute_value(val.get());
+ }
+ };
+
+ template <typename T, int N, bool Const>
+ struct is_negative<fusion::extension::adt_attribute_proxy<T, N, Const> >
+ {
+ static bool
+ call(fusion::extension::adt_attribute_proxy<T, N, Const> const& val)
+ {
+ return test_negative(val.get());
+ }
+ };
+
+ template <typename T, int N, bool Const>
+ struct is_zero<fusion::extension::adt_attribute_proxy<T, N, Const> >
+ {
+ static bool
+ call(fusion::extension::adt_attribute_proxy<T, N, Const> const& val)
+ {
+ return test_zero(val.get());
+ }
+ };
 }}}
 
 #endif


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