[Spirit Development] Bug using Phoenix::new_ in Qi semantic actions.
Robert Nelson <[email protected]> Tue, 28 Dec 2010 04:37:45 -0700
| Newsgroups | gmane.comp.parsers.spirit.devel |
|---|---|
| Message-ID | <[email protected]> |
I am trying to create a parser that constructs objects on the heap
instead of the stack so I can use polymorphic pointers. The natural
way to implement this seemed to be using the Object classes in
phoenix.
Why doesn't the following compile? Is it a bug, or am I using new_ incorrectly?
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/home/phoenix/object/new.hpp>
int main()
{
using namespace boost::spirit::qi;
using namespace boost::phoenix;
boost::spirit::qi::rule<std::string::const_iterator,int*()> rule =
eps[_val = new_<int>(5)];
}
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Spirit-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
main.cpp
(text/x-c++src, 275 B)
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/home/phoenix/object/new.hpp>
int main()
{
using namespace boost::spirit::qi;
using namespace boost::phoenix;
boost::spirit::qi::rule<std::string::const_iterator,int*()> rule = eps[_val = new_<int>(5)];
}