crayzeewulf / libserial

Serial Port Programming in C++
BSD 3-Clause "New" or "Revised" License
415 stars 142 forks source link

SerialStream::operator=(const LibSerial::SerialStream&)’ is private #60

Closed bidasknakayama closed 8 years ago

bidasknakayama commented 8 years ago

Hello

To copy "SerialStream" instance to array, it is not possible with this error.

SerialStream.h:260:27: error:
 ‘LibSerial::SerialStream& LibSerial::SerialStream::operator=
(const LibSerial::SerialStream&)’ is private

if I comment out 2 line and re-build, Is it be problem ?

SerialStream( const SerialStream& ) ;
SerialStream& operator=( const SerialStream& ) ;

I want to copy instance to array to use later.. Please advice me.

Kazu

crayzeewulf commented 8 years ago

Kazu,

Instances of SerialStream class cannot be copied in the current design. If you need to put them in an arrays please consider using std::unique_ptr or std::shared_ptr.

CrayzeeWulf