|
Boost-Commit : |
From: eric_at_[hidden]
Date: 2008-02-06 17:57:57
Author: eric_niebler
Date: 2008-02-06 17:57:57 EST (Wed, 06 Feb 2008)
New Revision: 43134
URL: http://svn.boost.org/trac/boost/changeset/43134
Log:
add handy get() accessors on literal<> wrapper
Text files modified:
trunk/boost/xpressive/proto/literal.hpp | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
Modified: trunk/boost/xpressive/proto/literal.hpp
==============================================================================
--- trunk/boost/xpressive/proto/literal.hpp (original)
+++ trunk/boost/xpressive/proto/literal.hpp 2008-02-06 17:57:57 EST (Wed, 06 Feb 2008)
@@ -40,6 +40,10 @@
typedef extends<terminal_type, literal<T, Domain>, Domain> base_type;
public:
+ typedef typename proto::result_of::arg<terminal_type>::type value_type;
+ typedef typename proto::result_of::arg<terminal_type>::reference reference;
+ typedef typename proto::result_of::arg<terminal_type>::const_reference const_reference;
+
template<typename U>
literal(U &u)
: base_type(terminal_type::make(u))
@@ -56,6 +60,16 @@
{}
using base_type::operator =;
+
+ reference get()
+ {
+ return proto::arg(*this);
+ }
+
+ const_reference get() const
+ {
+ return proto::arg(*this);
+ }
};
}
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