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

  • SEARCH
  • Home
  • 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 6015415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:49:59+00:00 2026-05-23T02:49:59+00:00

In C# with Linq, I would write: myContainer.Select(o => o.myMember); I’m not sure what

  • 0

In C# with Linq, I would write:

myContainer.Select(o => o.myMember);

I’m not sure what the syntax should be for C++/lambda/range. I’m simply trying to adapt a container of some object type to a container of strings so that I can pass it to boost::algorithm::join. I tried something like:

using namespace boost::adaptors;
using namespace boost::lambda;
string result = join(myContainer | transformed(_1.myMember), ", ");

But obviously that doesn’t work or I wouldn’t be here. 😉

I’m using transformed after reading:
http://www.boost.org/doc/libs/1_43_0/libs/range/doc/html/range/reference/adaptors/reference/transformed.html

I want to use a lambda instead of a separate function for brevity.

  • 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-23T02:49:59+00:00Added an answer on May 23, 2026 at 2:49 am

    operator. is not overloadable, thus it can never do anything sensible on a placeholder.


    Boost.Lambda (and Boost.Phoenix v1 and v2, which were based on Boost.Lambda) implements its own result_of protocol rather than the TR1 result_of protocol, so Boost.Lambda functors will not work with anything using boost::result_of or std::tr1::result_of (as Boost.Range does).

    That said, Boost.Phoenix v3, slated to be released in Boost 1.47, is the official replacement for Boost.Lambda and does implement the TR1 result_of protocol, and so does play nice with boost::result_of (and consequently Boost.Range).

    Your options are to either use Boost.Bind instead of Boost.Lambda, in which case the following is valid:

    transformed(bind(&myObjectType::myMember, _1))
    

    or you can use Boost.Phoenix v3 instead of Boost.Lambda (either get Boost.Phoenix out of trunk now or wait for Boost 1.47), in which case the Boost.Bind syntax is valid, as well as the following alternative:

    transformed(_1->*&myObjectType::myMember)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would you write this exact same query using the LINQ query syntax? var
So, In my old Linq-To-SQL I would write code like this var tableItem =
How would one write a LINQ query which takes a hierarchical source data and
How would i write something like this in linq to entities sb.Append( WHERE question.question_isdeleted
I'm trying to write a Linq (to Objects) query that casts the results to
Okay, I am trying to write a LINQ query with a Join in it,
How would you write this exact SQL query with the new Linq-to-NHibernate Provider (3.x)
How to write a LINQ query that would return row of type Value with
How could I write an ORM that would convert LINQ into SQL? I already
I would like to know how I can write an inner join in Linq

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.