// BOOST Includes
#include // Boost::Assign
#include // Boost::Assign::List_Of
#include <
I would try
const map<x3_string_tuple, string> query_selector_map = map_list_of<x3_string_tuple, string>
(x3_string_tuple("4556", "SELECT", "FILENAME"), "4556_SELECT_FILENAME");
But, honestly, maybe it's easier just to have 3 separate lists of strings, and then one-by-one combine them into a tuple and add that to a map.
I tried this, and it fails because the keys of the map need to be comparable (with std::less
, thus there needs to be an operator<
defined). boost::tuple
's comparison operators are defined in the header boost/tuple/tuple_comparison.hpp
.
Having included that, this code works fine:
#include <boost/assign/list_of.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <map>
#include <string>
using std::string;
typedef boost::tuple<string, string, string> tpl_t;
int main() {
using boost::assign::map_list_of;
std::map<tpl_t, string> const m =
map_list_of(tpl_t("a","b","c"), "c")(tpl_t("x","y","c"), "z");
}