|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73558 - in trunk/boost/spirit: home/support include
From: joel_at_[hidden]
Date: 2011-08-05 21:05:28
Author: djowel
Date: 2011-08-05 21:05:27 EDT (Fri, 05 Aug 2011)
New Revision: 73558
URL: http://svn.boost.org/trac/boost/changeset/73558
Log:
Moved extended_variant into its own file(s)
Added:
trunk/boost/spirit/home/support/extended_variant.hpp (contents, props changed)
trunk/boost/spirit/include/support_extended_variant.hpp (contents, props changed)
Text files modified:
trunk/boost/spirit/home/support/attributes.hpp | 48 ----------------------------------------
1 files changed, 0 insertions(+), 48 deletions(-)
Modified: trunk/boost/spirit/home/support/attributes.hpp
==============================================================================
--- trunk/boost/spirit/home/support/attributes.hpp (original)
+++ trunk/boost/spirit/home/support/attributes.hpp 2011-08-05 21:05:27 EDT (Fri, 05 Aug 2011)
@@ -50,54 +50,6 @@
#include <ios>
///////////////////////////////////////////////////////////////////////////////
-namespace boost { namespace spirit
-{
- template <
- BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
- BOOST_VARIANT_LIMIT_TYPES,
- typename T, boost::detail::variant::void_)
- // We should not be depending on detail::variant::void_
- // but I'm not sure if this can fixed. Any other way is
- // clumsy at best.
- >
- struct extended_variant
- {
- // tell spirit that this is an adapted variant
- struct adapted_variant_tag;
-
- typedef boost::variant<
- BOOST_VARIANT_ENUM_PARAMS(T)>
- variant_type;
- typedef typename variant_type::types types;
-
- typedef extended_variant<BOOST_VARIANT_ENUM_PARAMS(T)> base_type;
-
- extended_variant() : var() {}
-
- template <typename T>
- extended_variant(T const& var)
- : var(var) {}
-
- template <typename F>
- typename F::result_type apply_visitor(F v) const
- {
- var.apply_visitor(v);
- }
-
- variant_type const& get() const
- {
- return var;
- }
-
- variant_type& get()
- {
- return var;
- }
-
- variant_type var;
- };
-}}
-
namespace boost { namespace spirit { namespace traits
{
///////////////////////////////////////////////////////////////////////////
Added: trunk/boost/spirit/home/support/extended_variant.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/home/support/extended_variant.hpp 2011-08-05 21:05:27 EDT (Fri, 05 Aug 2011)
@@ -0,0 +1,66 @@
+/*=============================================================================
+ Copyright (c) 2001-2011 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_EXTENDED_VARIANT_AUGUST_6_2011_0859AM)
+#define BOOST_SPIRIT_EXTENDED_VARIANT_AUGUST_6_2011_0859AM
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/variant.hpp>
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit
+{
+ template <
+ BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
+ BOOST_VARIANT_LIMIT_TYPES,
+ typename T, boost::detail::variant::void_)
+ // We should not be depending on detail::variant::void_
+ // but I'm not sure if this can fixed. Any other way is
+ // clumsy at best.
+ >
+ struct extended_variant
+ {
+ // tell spirit that this is an adapted variant
+ struct adapted_variant_tag;
+
+ typedef boost::variant<
+ BOOST_VARIANT_ENUM_PARAMS(T)>
+ variant_type;
+ typedef typename variant_type::types types;
+
+ typedef extended_variant<BOOST_VARIANT_ENUM_PARAMS(T)> base_type;
+
+ extended_variant() : var() {}
+
+ template <typename T>
+ extended_variant(T const& var)
+ : var(var) {}
+
+ template <typename F>
+ typename F::result_type apply_visitor(F v) const
+ {
+ var.apply_visitor(v);
+ }
+
+ variant_type const& get() const
+ {
+ return var;
+ }
+
+ variant_type& get()
+ {
+ return var;
+ }
+
+ variant_type var;
+ };
+}}
+
+#endif
Added: trunk/boost/spirit/include/support_extended_variant.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/include/support_extended_variant.hpp 2011-08-05 21:05:27 EDT (Fri, 05 Aug 2011)
@@ -0,0 +1,18 @@
+/*=============================================================================
+ Copyright (c) 2001-2010 Joel de Guzman
+ Copyright (c) 2001-2010 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_EXTENDED_VARIANT
+#define BOOST_SPIRIT_INCLUDE_SUPPORT_EXTENDED_VARIANT
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/home/support/extended_variant.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