2011年5月28日土曜日

boost::variant C2666エラー

http://www.google.com/search?hl=ja&num=50&q=boost+variant+C2666&btnG=%E6%A4%9C%E7%B4%A2&lr=

http://archives.free.net.ph/message/20080812.033907.6aca6b1c.ja.html
こういうプログラムでVisualC++でエラーC2666

これに対して
http://archives.free.net.ph/message/20080812.035333.cd4ff2a0.ja.html
こう直せと

具体的には
typedef boost::variant numeric_type_variant;

class numeric_type : public Super {
Super& super() { return *this; }
public:
numeric_type() { }
template
numeric_type(T const& t) { }
numeric_type(numeric_type const& t) : numerit_type_variant(t.super()) { } //ここが重要
template
numeric_type& operator=( T const& t ) {
return *this;
}
numeric_type& operator=( const Super& t ) {
super()= t; //ここも重要
return *this;
}
};

variantをメンバ変数にするとこう
http://www.mail-archive.com/qpid-dev@incubator.apache.org/msg12561.html


0 件のコメント:

コメントを投稿