I am defining a boost multiindex container:
namespace bmi = boost::multi_index;
struct DijkstraTriplet {
...
};
typedef multi_index_container <
DijkstraTriplet,
bmi::indexed_by<
bmi::ordered_unique<bmi::member<DijkstraTriplet,size_t,&DijkstraTriplet::linkId> >,
bmi::ordered_non_unique<bmi::identity<DijkstraTriplet> >
>
> DijkstraTripletContainer;
at some point I am filling it with data and would like to scan one of its indexes. For that purpose I define an iterator:
DijkstraTripletContainer::nth_index<0>::type::iterator it;
(using an old compiler). This is incredibly long and awkward. To make it shorter and more readable I added those lines:
#define dtt0 DijkstraTripletContainer::nth_index<0>::type
#define dtt1 DijkstraTripletContainer::nth_index<1>::type
and then used dtt0::iterator (which is elegantly short, but at the same time ugly, because expressed in terms of #defines). Is there a more elegant way to have a shortcut without #defines? I am looking something as elegant as
namespace bmi = boost::multi_index;
Comments?
1 Answer