只有构造函数采用成员初始化器

时间:2015-07-09 15:28:25

标签: c++

我正在尝试安装模拟器。在尝试编译源文件时,我从下面的代码中获取标题中的错误消息。

#include "core.hpp"
core::core(const pe_id &id, const uint64_t &t,
           shared_ptr<id_factory<packet_id> > pif,shared_ptr<tile_statistics> st, 
           logger &l, shared_ptr<random_gen> r, shared_ptr<memory> mem, 
           uint32_t number_of_core_msg_types, uint32_t msg_q_size, uint32_t 
           bytes_per_flit) throw(err) : pe(id), system_time(t), stats(st), log(l), ran(r),
           m_msg_queue_size(msg_q_size), m_bytes_per_flit(bytes_per_flit), 
           m_memory(mem), m_packet_id_factory(pif), 
           m_receive_channel_round_robin_pointer(0), m_send_queue_round_robin_pointer(0)
{ 
  m_number_of_msg_types = number_of_core_msg_types + mem->number_of_mem_msg_types();
  m_first_core_msg_type = mem->number_of_mem_msg_types();
  for (uint32_t i = 0; i < m_number_of_msg_types; ++i) {
    m_in_msg_queues[i] = shared_ptr<messageQueue> (new messageQueue(i, m_msg_queue_size));
    m_out_msg_queues[i] = shared_ptr<messageQueue> (new messageQueue(i, m_msg_queue_size));
}
  m_memory->set_core_send_queues(m_out_msg_queues);
  m_memory->set_core_receive_queues(m_in_msg_queues);
}

我还附加了头文件中的核心类声明。核心:: core似乎是构造函数,但我仍然遇到了上述错误。

class core : public pe {
public:
core (const pe_id &id, const uint64_t &system_time,
     shared_ptr<id_factory<packet_id> > packet_id_factory,
     shared_ptr<tile_statistics> stats, logger &log,
     shared_ptr<random_gen> ran,
     shared_ptr<memory> mem,
     uint32_t number_of_core_msg_types, uint32_t msg_queue_size, uint32_t m_bytes_per_flit) throw(err);
virtual ~core() throw();

有任何帮助吗?

1 个答案:

答案 0 :(得分:1)

这里的问题是你的deprecated exception specification。它应该只是在声明而不是定义。