STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

select_2nd Struct Template Reference

Selects the second member of an instance and applies the parameterising functional to it. More...

#include <stlsoft_functionals.h>

List of all members.

Public Methods

 select_2nd ()
 Default constructor.

 select_2nd (F f)
 Constructs from the given function object, which it will then apply via operator()().

template<typename T> void operator() (T &t)
 Function call operator, which applies the parameterising function object to the second part of the pair t.


Detailed Description

template<typename F>
struct stlsoft::select_2nd< F >

Selects the second member of an instance and applies the parameterising functional to it.

This functional selects the "second" member of an instance (obviously this is usually the std::pair type), and applies the parameterising functional to it.

For example, if you have a std::map and wish to write out the values with a dump_value functional, you could achieve this with the following:

  std::for_each(m.begin(), m.end(), stlsoft::select_2nd<dump_value>());

Parameters:
F  The parameterising functional


Constructor & Destructor Documentation

select_2nd   [inline]
 

Default constructor.

select_2nd   f [inline, explicit]
 

Constructs from the given function object, which it will then apply via operator()().


Member Function Documentation

void operator() T &    t [inline]
 

Function call operator, which applies the parameterising function object to the second part of the pair t.

Parameters:
t  An instance of a pair like type, to whose second member will be applied the function F


The documentation for this struct was generated from the following file:

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004