|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r76928 - in trunk/boost/spirit: home/qi home/support include
From: joel_at_[hidden]
Date: 2012-02-07 01:12:50
Author: djowel
Date: 2012-02-07 01:12:49 EST (Tue, 07 Feb 2012)
New Revision: 76928
URL: http://svn.boost.org/trac/boost/changeset/76928
Log:
Support for BOOST_SPIRIT_AUTO and qi::copy.
Added:
trunk/boost/spirit/home/qi/copy.hpp (contents, props changed)
trunk/boost/spirit/home/support/auto.hpp (contents, props changed)
trunk/boost/spirit/include/qi_copy.hpp (contents, props changed)
trunk/boost/spirit/include/support_auto.hpp (contents, props changed)
Added: trunk/boost/spirit/home/qi/copy.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/home/qi/copy.hpp 2012-02-07 01:12:49 EST (Tue, 07 Feb 2012)
@@ -0,0 +1,32 @@
+/*=============================================================================
+ Copyright (c) 2001-2012 Joel de Guzman
+
+ 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)
+==============================================================================*/
+#if !defined(BOOST_SPIRIT_COPY_FEBRUARY_7_2012_0159PM)
+#define BOOST_SPIRIT_COPY_FEBRUARY_7_2012_0159PM
+
+#include <boost/config.hpp>
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/config.hpp>
+
+#if !defined(BOOST_NO_AUTO_DECLARATIONS)
+
+namespace boost { namespace spirit { namespace qi
+{
+ template <typename Expr>
+ typename boost::proto::result_of::deep_copy<Expr>::type
+ copy(Expr const& expr)
+ {
+ BOOST_SPIRIT_ASSERT_MATCH(boost::spirit::qi::domain, Expr);
+ return boost::proto::deep_copy(expr);
+ }
+}}}
+
+#endif
+#endif
Added: trunk/boost/spirit/home/support/auto.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/home/support/auto.hpp 2012-02-07 01:12:49 EST (Tue, 07 Feb 2012)
@@ -0,0 +1,35 @@
+/*=============================================================================
+ Copyright (c) 2001-2012 Joel de Guzman
+
+ 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)
+==============================================================================*/
+#if !defined(BOOST_SPIRIT_AUTO_FEBRUARY_7_2012_0159PM)
+#define BOOST_SPIRIT_AUTO_FEBRUARY_7_2012_0159PM
+
+#include <boost/config.hpp>
+#include <boost/typeof/typeof.hpp>
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/config.hpp>
+
+// Support for c++11 auto. See:
+// http://boost-spirit.com/home/articles/qi-example/zero-to-60-mph-in-2-seconds/
+// for more info
+
+#if defined(BOOST_NO_AUTO_DECLARATIONS)
+
+#define BOOST_SPIRIT_AUTO(domain_, name, expr) \
+ typedef boost::proto::result_of:: \
+ deep_copy<BOOST_TYPEOF(expr)>::type name##_expr_type; \
+ BOOST_SPIRIT_ASSERT_MATCH( \
+ boost::spirit::domain_::domain, name##_expr_type); \
+ BOOST_AUTO(name, boost::proto::deep_copy(expr)); \
+ /****/
+
+#endif
+
+#endif
Added: trunk/boost/spirit/include/qi_copy.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/include/qi_copy.hpp 2012-02-07 01:12:49 EST (Tue, 07 Feb 2012)
@@ -0,0 +1,17 @@
+/*=============================================================================
+ Copyright (c) 2001-2012 Joel de Guzman
+ 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_COPY
+#define BOOST_SPIRIT_INCLUDE_SUPPORT_COPY
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/home/qi/copy.hpp>
+
+#endif
Added: trunk/boost/spirit/include/support_auto.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/include/support_auto.hpp 2012-02-07 01:12:49 EST (Tue, 07 Feb 2012)
@@ -0,0 +1,17 @@
+/*=============================================================================
+ Copyright (c) 2001-2012 Joel de Guzman
+ 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_AUTO
+#define BOOST_SPIRIT_INCLUDE_SUPPORT_AUTO
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/home/support/auto.hpp>
+
+#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