我目前正在调用find_or_construct - 一个boost api调用,但我在通话时遇到以下隐秘错误:
/usr/include/boost/container/map.hpp:147:1: error: invalid application of ‘sizeof’ to incomplete type ‘boost::STATIC_ASSERTION_FAILURE<false>’
以下find_or_construct导致问题:
BidInfoAllocator alloc_inst(m_bids_shm->get_segment_manager());
bids_map = m_bids_shm->find_or_construct<shm_bids_map>("Bidding")(std::less<shm_string>(),alloc_inst );
地图定义如下:
typedef boost::interprocess::allocator<imp_info, managed_shared_memory::segment_manager> ImpInfoAllocator;
typedef boost::interprocess::vector<imp_info, ImpInfoAllocator> shm_vec_impressions;
typedef std::pair<shm_string, std::pair<shm_string, shm_vec_impressions> > bid_value_type;
typedef boost::interprocess::allocator<bid_value_type, managed_shared_memory::segment_manager> BidInfoAllocator;
typedef boost::interprocess::map<shm_string, std::pair<shm_string, shm_vec_impressions> , std::less<shm_string>, BidInfoAllocator> shm_bids_map;
有人能注意到这里有什么问题吗?
非常感谢