I'm having trouble inheriting/invoking the constructor of a base class. I based the class off of a Boost.Asio example.
Here's the parent class:
#ifndef CLIENT_HPP
#define CLIENT_HPP
#include <iostream>
#include <memory>
#include <utility>
#include <boost/asio.hpp>
#include <boost/lexical_cast.hpp>
using boost::asio::ip::tcp;
class client : public std::enable_shared_from_this<client> {
public:
client(tcp::socket socket) : socket_(std::move(socket)) {
}
void start() {
}
tcp::socket socket_;
};
#endif
Here is the child class:
#ifndef PENGUIN_HPP
#define PENGUIN_HPP
#include "Client.hpp"
class penguin : public client {
public:
penguin() : client(socket_) {
}
};
#endif
This is how I'm initializing the Penguin class
std::make_shared<penguin>(std::move(socket_))->start();
socket_ here is the server's tcp::socket thingy.
I'm a C++ noob, so any help would be greatly appreciated!