Hello,
in these code I try to unpack the 1stand 2nd element, but it doesn't
compile (here, it complains about »apply« in »struct
boost::mpl::at_implboost::mpl::non_sequence_tag«
Is there a better way and how to get it to compile?
Thanks,
Olaf
---8<---
#include
#include
#include
#include
#include
#include
#include
#include
#include <iostream>
namespace mpl = boost::mpl;
struct code {
enum type {
undefined, foo, bar
};
};
typedef mpl::vector, mpl::size_t<0> >, // undefined
mpl::pair< mpl::size_t<1>, mpl::size_t<3> >, // foo
mpl::pair< mpl::size_t<2>, mpl::size_t<5> > // bar
arity_info;
template
struct min_arity
: mpl::at_c<
typename mpl::at_c::type, 0
>::type
{ };
// same for max_arity at index 1 (pair::second)
int main()
{
std::cout << "min arity = "
<< min_aritycode::bar::value << '\n';
// std::cout << "max arity = "
// << max_aritycode::bar::value << '\n';
}
--->8---