|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75484 - trunk/boost/spirit/home/support
From: joel_at_[hidden]
Date: 2011-11-14 05:31:36
Author: djowel
Date: 2011-11-14 05:31:35 EST (Mon, 14 Nov 2011)
New Revision: 75484
URL: http://svn.boost.org/trac/boost/changeset/75484
Log:
+ more get overloads
+ returning references instead of values
Text files modified:
trunk/boost/spirit/home/support/extended_variant.hpp | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
Modified: trunk/boost/spirit/home/support/extended_variant.hpp
==============================================================================
--- trunk/boost/spirit/home/support/extended_variant.hpp (original)
+++ trunk/boost/spirit/home/support/extended_variant.hpp 2011-11-14 05:31:35 EST (Mon, 14 Nov 2011)
@@ -84,11 +84,32 @@
namespace boost
{
template <typename T, BOOST_VARIANT_ENUM_PARAMS(typename T)>
- inline T
+ inline T const&
get(boost::spirit::extended_variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& x)
{
return boost::get<T>(x.get());
}
+
+ template <typename T, BOOST_VARIANT_ENUM_PARAMS(typename T)>
+ inline T&
+ get(boost::spirit::extended_variant<BOOST_VARIANT_ENUM_PARAMS(T)>& x)
+ {
+ return boost::get<T>(x.get());
+ }
+
+ template <typename T, BOOST_VARIANT_ENUM_PARAMS(typename T)>
+ inline T const*
+ get(boost::spirit::extended_variant<BOOST_VARIANT_ENUM_PARAMS(T)> const* x)
+ {
+ return boost::get<T>(&x->get());
+ }
+
+ template <typename T, BOOST_VARIANT_ENUM_PARAMS(typename T)>
+ inline T*
+ get(boost::spirit::extended_variant<BOOST_VARIANT_ENUM_PARAMS(T)>* x)
+ {
+ return boost::get<T>(&x->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