Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6679247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:20:15+00:00 2026-05-26T04:20:15+00:00

Simple example using boost::phoenix: #include <vector> #include <algorithm> #include <boost/phoenix.hpp> namespace ph = boost::phoenix;

  • 0

Simple example using boost::phoenix:

#include <vector>
#include <algorithm>
#include <boost/phoenix.hpp>

namespace ph = boost::phoenix;
namespace place = boost::phoenix::placeholders;

struct A
{
    int val_;
    explicit A(int i) : val_(i) {}
    int foo() { return val_;}
};

int main()
{
    std::vector<A> coll;
    coll.push_back(A(2));
    coll.push_back(A(4));
    coll.push_back(A(5));
    coll.push_back(A(7));

    std::vector<A>::const_iterator cit;
    cit = std::find_if(coll.begin(), coll.end(), ph::bind(&A::foo, place::_1) % 2 == 1);
    int val = (*cit).val_;

    return 0;
}

It compiles but there are some warnings at the output of VS2008:

c:\boost_1_47_0\boost\phoenix\bind\detail\member_variable.hpp(54) : warning C4180: qualifier applied to function type has no meaning; ignored

Where it came from: 1) incorrectness in code 2) again MS problems. 3) boost::phoenix library not doing well?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:20:15+00:00Added an answer on May 26, 2026 at 4:20 am

    It looks like the Boost devs decided that they weren’t going to workaround this, perhaps since it was determined to be an error on the part of the compiler. Here’s a link:

    https://svn.boost.org/trac/boost/ticket/1097

    I think this is for general boost::bind(), but I’d bet that this probably won’t be fixed. There’s a workaround suggested in that ticket. You might try that (it just disables the warning).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very simple example: #include <string> #include <boost/program_options.hpp> namespace po = boost::program_options; int main(int argc,
Trying to build the following simple example #include <boost/python.hpp> using namespace boost::python; tuple head_and_tail(object
Okay so basically : i have this simple example: main.cpp using namespace VHGO::Resource; std::list<BaseTable*>
I'm trying to do a simple example using jQuerys fadeTo method. It works as
For a simple example of using a NSMutableArray of strings called rows, what do
Can someone share a simple example of using the foreach keyword with custom objects?
I have this very simple example that I am using to learn structs in
There is a simple POD data type like struct Item { int value1; double
I have been toying with an example hpp provided in the boost library and
I can't find a proper way how to access members of boost::variant using boost::phoenix

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.