lite::sub_pack< pack_type_, keep0_..., keepN_ > Class Template Reference
[Tool Classes]

This class can be used to define and extract a subset of element of a pack as another pack. More...

#include <array.hpp>

List of all members.

Public Types

typedef pack_type_ input_pack_type
 The original pack type.
typedef pack<...> type
 The subset pack type.

Static Public Member Functions

static void set (type &res, input_pack_type::type0 a0,..., input_pack_type::typeN aN)
 Set the elements of res using only the corresponding elements from a0 to aN.
static void set (type &res, const input_pack_type &org)
 Set the elements of res using only the corresponding elements from org.

Detailed Description

template<typename pack_type_, bool keep0_..., bool keepN_>
class lite::sub_pack< pack_type_, keep0_..., keepN_ >

This class can be used to define and extract a subset of element of a pack as another pack.

The following is te pseudo class definition of the sub_pack class.

template<typename type0_, ..., typename typeN_, bool keep0_, ..., bool keepN_>
class sub_pack<pack<type0_, ... , typeN_>, keep0_, ..., keepN_>
{
public:
    typedef pack<type0_, ... , typeN_> input_pack_type;

    typedef pack<???> type; // for each X in in [0, N], typeX_ is included only if keepX_ is true.

    static void set(type& res, input_pack_type::type0 a0, ..., input_pack_type::typeN aN);

    static void set(type& res, const input_pack_type& org);
};
Example:
        typedef pack<int, constant<int, 5>, std::string> Pack;
        typedef sub_pack<Pack, true, true, false> SubPack;

        Pack p(1, 0, "hello");
        SubPack::type sub_p;

        SubPack::set(sub_p, p);
        std::cout << p << std::endl;
        std::cout << sub_p << std::endl;

The output would be:

        1 5 hello
        1 5
    

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Defines

Generated on Fri Nov 6 02:03:21 2009 for Lite by  doxygen 1.6.0