() :
:
template <std::size_t N>
void handle(const std::array<char, N>& msg, std::vector<boost::asio::const_buffer>& buffers)
{
}
. , () N.
:
template <>
void handle(const std::array<char, 10>& msg, std::vector<boost::asio::const_buffer>& buffers)
template <>
void handle(const std::array<char, 20>& msg, std::vector<boost::asio::const_buffer>& buffers)
- ( ). , .
Therefore, in order for them to be virtual, there must be 2 entries in the table of virtual functions.
This, for example, will work:
class Handler:
{
public:
virtual void handle(const std::array<char, 10>& msg, std::vector<boost::asio::const_buffer>& buffers) = 0;
virtual void handle(const std::array<char, 20>& msg, std::vector<boost::asio::const_buffer>& buffers) = 0;
};
source
share