Шаблоны конструкторов в нешаблоном классе C++C++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 Шаблоны конструкторов в нешаблоном классе C++

Сообщение Anonymous »


I have a non-template class (Uart) and want to create template constructor. It needs to take another template class object (SafeQueue). Then this constructor will call another template function defined inside the class.

class signatures are given below;

class UartCommunication { public: UartCommunication(const char *port, speed_t baudRate); template UartCommunication(const char* port, speed_t baudRate, SendQueue& sendQueue, ReceiveQueue& receiveQueue, int pollingTime, bool sendIfReceived) { port_ = port; baudRate_ = baudRate; serial_fd_ = open(port_, O_RDWR | O_NOCTTY | O_NDELAY); if (serial_fd_ == -1) { std::cerr

Источник: https://stackoverflow.com/questions/781 ... te-class-c
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»