خطأ: boost.fusion :: for_each () و struct مشتقة من boost.tuple
-
26-09-2019 - |
سؤال
على التجميع هذا الرمز:
struct any_type: boost::tuple<std::string, std::string, std::string> {
...
};
struct functor {
void operator()(const std::string& v) {
std::cout << v << std::endl;
}
};
int main() {
any_type type;
boost::fusion::for_each(type, functor());
}
احصل على خطأ: لا يوجد نوع اسمه "فئة" في "struct any_type" لماذا؟ أريده أن يرث من Boost.tuple.
المحلول
ورث من boost::fusion::tuple
بدلاً من boost::tuple
.
ملحوظة: النظر في صنع void operator()(const std::string& v)
مقدار ثابت
لا تنتمي إلى StackOverflow