以下のコードがコンパイル出来ずに困っております。
#ifndef __DATA_H__
#define __DATA_H__
#include <vector>
#include <map>
#include <boost/assign/list_of.hpp>
template <typename T>
class Data{
public:
Data();
private:
const std::map<T, std::vector<T> > data;
};
#endif
#include "Data.h"
template<typename T>
Data<T>::Data():data(static_cast<const std::map<T, std::vector<T> > &>
(boost::assign::map_list_of<T, const std::vector<T> >
(-173.0,
static_cast<const std::vector<T> &>(
boost::assign::list_of(93.5)(2.88)(4.46))))
(-123.0,
static_cast<const std::vector<T> &>(
boost::assign::list_of(48.8)(5.95)(3.835)))
){}
/////////////////
template class Data<double>;
/code]
MAPに与えるペアの一つ目だけならコンパイルが通るのですが、
2つめまで入れると以下のようなエラーが発生します。
Data.cpp: コンストラクタ ‘Data<T>::Data() [with T = double]’ 内:
Data.cpp:20:26: instantiated from here
Data.cpp:14:7: エラー: ‘(const std::map<double, std::vector<double, std::allocator<double> >, std::less<double>, std::allocator<std::pair<const double, std::vector<double, std::allocator<double> > > > >) (double, const std::vector<double, std::allocator<double> >&)’ への呼び出しが適合しません
make: *** [Data.o] エラー 1
環境はGCC4.6.2です。
お分かりになる方がいらっしゃりましたらご指導いただければ幸です。
よろしくお願いします。