[functional] A new version of a selector (Boost.Select)

Hi Everyone, Is there interest in a real simple utility which chooses either the first or second element in a pair that can be used with STL algorithms? I'm attaching it with the appropriate Boost Software License. I hope this helps! -- Dean Michael Berris Software Engineer, Friendster, Inc. <dmberris@friendster.com> +639287291459

I would definitely use this, but it would be even better if it was also extended for use with tuples of size N > 2. Zach On Thu, Apr 17, 2008 at 3:06 AM, Dean Michael C. Berris <dmberris@friendster.com> wrote:
Hi Everyone,
Is there interest in a real simple utility which chooses either the first or second element in a pair that can be used with STL algorithms?
I'm attaching it with the appropriate Boost Software License.
I hope this helps!
-- Dean Michael Berris Software Engineer, Friendster, Inc. <dmberris@friendster.com> +639287291459
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

On Thu, Apr 17, 2008 at 8:42 PM, Zach Laine <whatwasthataddress@gmail.com> wrote:
I would definitely use this, but it would be even better if it was also extended for use with tuples of size N > 2.
I'm currently looking at maybe dabbling a little in Boost.Fusion and creating function object extensions to at_c<>. Maybe Joel already has something like this, but that's definitely something which I think will be useful. -- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://blog.cplusplus-soup.com] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]

Hi, I'm not sure if I'm missing something here, but how exactly do you intend to combine boost::select<#> with STL algorithms? Let's say that you have a map and want to apply a functor on one of the members of the pair with the for_each algorithm using boost::select<#>. Cheers, Themis On Thu, Apr 17, 2008 at 9:06 AM, Dean Michael C. Berris < dmberris@friendster.com> wrote:
Hi Everyone,
Is there interest in a real simple utility which chooses either the first or second element in a pair that can be used with STL algorithms?
I'm attaching it with the appropriate Boost Software License.
I hope this helps!
-- Dean Michael Berris Software Engineer, Friendster, Inc. <dmberris@friendster.com> +639287291459
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

On Fri, Apr 18, 2008 at 12:55 AM, Themis Bourdenas <bourdenas@gmail.com> wrote:
Hi,
I'm not sure if I'm missing something here, but how exactly do you intend to combine boost::select<#> with STL algorithms? Let's say that you have a map and want to apply a functor on one of the members of the pair with the for_each algorithm using boost::select<#>.
Right now, I can't think of a way yet of how to do this. But the intention here is to be able to do this: transform(my_map.begin(), my_map.end(), boost::make_function_output_iterator(my_function), boost::select<0>()); This will take the first argument of the pair contained in the map and feed it into 'my_function'. I hope this makes sense. -- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://blog.cplusplus-soup.com] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]
participants (4)
-
Dean Michael Berris
-
Dean Michael C. Berris
-
Themis Bourdenas
-
Zach Laine