Here is an example of the described behaviour
Here, it does not compile with non modified composite_key.hpp file, and
do compile with modified file.
Regards,
Mathieu Peyréga
-----------------------------
test_multi_index.cpp
-----------------------------
#include <string>
#include
#include
#include
#include
#include
#include
using namespace boost;
using namespace boost::multi_index;
class GPS_Station
{
public:
GPS_Station(void);
GPS_Station(GPS_Station const& station);
GPS_Station& operator=(GPS_Station const& station);
~GPS_Station(void);
unsigned long m_Id;
std::string m_Name;
std::string m_DomeNumber;
double m_Epoch;
double m_X_ECEF;
double m_Y_ECEF;
double m_Z_ECEF;
};
class CTestMultiIndex
{
public:
// Tags pour l'utilisation du multi-index container de Boost en
mode "Tag"
typedef composite_key,
member > by_id_and_epoch;
typedef composite_key,
member > by_id_and_epoch;
typedef composite_key,
member > by_name_and_epoch;
typedef composite_key,
member > by_domenumber_and_epoch;
typedef composite_key,
member > by_epoch_and_id;
typedef composite_key,
member > by_epoch_and_name;
typedef composite_key,
member >
by_epoch_and_domenumber;
typedef multi_index_container,
ordered_non_unique,
ordered_non_unique,
ordered_unique,
ordered_unique,
ordered_unique >
> DataSetType;
typedef nth_index::type dataset_by_id_and_epoch;
typedef nth_index::type dataset_by_name_and_epoch;
typedef nth_index::type dataset_by_domenumber_and_epoch;
typedef nth_index::type dataset_by_epoch_and_id;
typedef nth_index::type dataset_by_epoch_and_name;
typedef nth_index::type dataset_by_epoch_and_domenumber;
void fail_to_compile(DataSetType& dataset, std::string const&
stationname, std::string const& prefix);
}; // class CTestMultiIndex
void CTestMultiIndex::fail_to_compile(DataSetType& dataset, std::string
const& stationname, std::string const& prefix)
{
const dataset_by_name_and_epoch &datasetbynameandepoch =
get<1>(dataset);
std::pair range =
datasetbynameandepoch.equal_range(stationname);
}