Boost logo

Boost Users :

Subject: [Boost-users] [MPL] at<> function with too many arguments
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2009-08-31 22:47:33


I have a mpl::map as follows, with a template parameter of a passed in
type and a template parameter of "supported_type" that is a class.

using boost::mpl;
enum { value = 1 + supported_type::value };
typedef typename insert<typename supported_type::type_map, pair<T,
int_<value> > >::type type_map;

I'm trying to create a function that searches the map for a given type
and returns a numeric value if it's found or -1 if it's not found.

template <typename S> int typeValue(void) {
  return at< type_map, S, int_<-1> >::type::value;
}

The documentation says I can specify a default value for "at" that is
returned if the given key isn't found. The compiler, though, says that
I've provided too many arguments. Have I called "at" incorrectly? Is
the documentation incorrect? Is the fault with the compiler (VS 2005)?

Ryan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net