Boost.Phoenix is a C++ library to enable function programming in C++.
Questions tagged [boost-phoenix]
159 questions
1
vote
1 answer
Displaying a Flattened Phoenix Expression using Boost Fusion
Following the Expressions as Fusion Sequences section of the Proto User Guide, I get to the point where I iterate over a flattened proto expression: _1 + 2 + 3 + 4:
#include
#include
namespace proto =…

user2023370
- 10,488
- 6
- 50
- 83
1
vote
0 answers
User defined arguments in Boost Phoenix
The Boost Phoenix documentation here indicates that I can create my own (lambda) arguments instead of _1/arg1, _2,arg2 etc. So, starting with code like this:
#include
#include
int main(int argc, char *argv[]) {
…

user2023370
- 10,488
- 6
- 50
- 83
1
vote
3 answers
What functional language approach most readily transfers to Boost Phoenix?
I am looking to learn functional programming with an am to integrate Boost.phoenix into my project.
What language is most similar so that I can find books that will illustrate functional programming concepts in a way that can be readily applies in…

eigen_enthused
- 525
- 6
- 17
1
vote
2 answers
Compiliation errors on boost files
I'm getting a lot of errors compiling code using the boost libraries, mainly when I'm using Spirit namespace. The errors are syntax errors on boost files like:
boost/spirit/home/classic/dynamic/lazy.hpp(33) : error C2143: syntax error : missing ';'…

Leandro Lima
- 1,140
- 3
- 24
- 42
1
vote
0 answers
access tuple as back element of vector by boost :: phoenix used in boost :: qi grammar
How do I access tuple as back element of vector by boost::phoenix used in grammar. I want to set 2nd element of tuple of the back element of vector (which was added earlier)
for example
typedef boost::tuple…

user1690723
- 21
- 1
1
vote
1 answer
using boost.phoenix container algorithms
I have a Visual Studio 2008 C++03 application using boost 1.47 phoenix (Update: also with 1.49). I would like to define a boost::function to remove an element from a list. For example:
#include
#include…

PaulH
- 7,759
- 8
- 66
- 143
0
votes
1 answer
Boost binding with member functions/variables
Class A has access to class B.
In a class B function, I'd like to call a function defined in class A, and pass to it arguments from class B.
So in class A I try to write the following to provide the desired function to class B.
A::provideFunction
{
…

Smash
- 3,722
- 4
- 34
- 54
0
votes
2 answers
boost::phoenix::sort error
I am trying to sort a vector below using boost::phoenix library. The class Foo has a member function 'int getvalue()'. The purpose is to sort the vector using the value returned by 'getvalue()'. But something is missing. I get compiler error as…

polapts
- 5,493
- 10
- 37
- 49
0
votes
1 answer
boost::phoenix with VS2008
Simple example using boost::phoenix:
#include
#include
#include
namespace ph = boost::phoenix;
namespace place = boost::phoenix::placeholders;
struct A
{
int val_;
explicit A(int i) : val_(i) {}
…

sigidagi
- 864
- 7
- 17
0
votes
1 answer
Boost phoenix actor as a fusion callable object
I was wondering if it was possible to create callable phoenix actors and use them in fusion sequences.
Given the following source:
struct FusionStruct
{
void Doit() const{std::cout << "Doit" << std::endl;}
};
struct FusionCaller
{
template…

mkaes
- 13,781
- 10
- 52
- 72
0
votes
1 answer
How can I use multiple filters on a single sink with boost::log
I'm using a sink to log information and a file with information on the different levels I want for each tag I created like so:
sink->set_filter(logging::trivial::severity >= logging::trivial::warning && expr::attr("Tag") ==…

Forague
- 145
- 8
0
votes
1 answer
Boost::spirit::qi parse alternative variant
I need to parse string with parameters A and B. Order of the parameters not defined. I.e. string can be present as one of the next formats
A="value1",B="value2"
B="value1",A="value2"
Part of my code you can see below. But in that code I can parse…

Валентин Никин
- 357
- 2
- 11
0
votes
2 answers
c++ functional programming ( boost::phoenix && boost::spirit) testing for null-ptrs in pointer placeholders
So, I have the following spirit karma rule body:
base_rule =
eps(_r1 != 0) [ // _r1 is a pointer_typed placeholder
eps
]
;
which leads to a rather long error message from g++ which (helpfully) ends with :…

Hassan Syed
- 20,075
- 11
- 87
- 171
0
votes
1 answer
Create parser using boost spirit in C++ which creates the AST using existing classes
I am trying to write a parser using boost spirit in C++. I want the output of this parser in the form of class objects. I read about semantic actions but I'm not sure how to create my class objects in these actions.
Also, I read that "boost phoenix"…

vinzee93
- 91
- 7
0
votes
0 answers
boost phoenix eval failures
While trying to make a smaller reproducible case from my code base, I reach the code below.
For me, it fails to compile with g++6.1 and boost 1.60 and boost develop.
The grammars and rules use default types for the skipper and the other bit and only…

MMM
- 910
- 1
- 9
- 25