tôi nhận ra lỗi biên dịch sau đây:Tại sao tôi không thể lưu trữ tăng :: chức năng trong std :: list?
error: expected `;' before 'it'"
Dưới đây là mã của tôi:
#include <boost/function.hpp>
#include <list>
template< class T >
void example() {
std::list< boost::function<T()> >::iterator it;
}
Tại sao điều này xảy ra? Làm thế nào tôi có thể sửa chữa nó?