NonCopyable: Fix edit.

pull/8509/head
Vincent Coubard 2018-10-24 08:35:10 +01:00 committed by GitHub
parent acaf96834e
commit abeab68729
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -82,11 +82,11 @@ namespace mbed {
* There is a subtle bug in this code, the function get_connection returns a
* reference to a Connection which is captured by value instead of reference.
*
* When the reference get_connection returns is copied into connection, the
* vtable and others members defined in Connection are copied, but members defined
* in SerialConnection are left apart. This can cause severe crashes or bugs if
* the virtual functions captured use members not present in the base
* declaration.
* When `get_connection` returns a reference to serial_connection it is copied into
* the local variable connection. The vtable and others members defined in Connection
* are copied, but members defined in SerialConnection are left apart. This can cause
* severe crashes or bugs if the virtual functions captured use members not present
* in the base declaration.
*
* To solve that problem, the copy constructor and assignment operator have to
* be declared (but don't need to be defined) in the private section of the