lilypond-auto
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lilypond-auto] Issue 4156 in lilypond: Patch: Define Smob<> constru


From: lilypond
Subject: Re: [Lilypond-auto] Issue 4156 in lilypond: Patch: Define Smob<> constructors.
Date: Wed, 08 Oct 2014 15:12:02 +0000

Updates:
        Status: Started
        Owner: address@hidden
        Labels: -Patch-review Patch-new

Comment #3 on issue 4156 by address@hidden: Patch: Define Smob<> constructors.
https://code.google.com/p/lilypond/issues/detail?id=4156#c3

Issue 4156: Define Smob<> constructors

The purpose of this patch is to stop the previous implicit copying of
Smob<> data members in derived copy constructors.

To that purpose, Smob<> has received a private copy constructor (which
gcc unfortunately only considers worth a warning rather than an error
when implicitly used in a default copy constructor) and an inline
default constructor.

Several classes contained virtual copy constructors without being
actually copyable have had their copy constructor removed.

Several copy constructors just containing a failing assertion were
instead removed and left (privately) declared but not defined.  This
standard C++ practice leads to link time rather than run time errors in
case an instance of such a class is copied.

Other smob-defining base classes (Simple_smob and Smob{1,2,3}) do not
actually have non-static data members that could be initialized.

Prohibiting the copying of Simple_smob as a base class seems rather
pointless as all of the data members of a derived class are under the
control of the derived class.  However, Smob{1,2,3} "misuse" the this
pointer to contain an SCM value.  Creating a copy would change the
associated address, a very undesirable operation.  So Smob{1,2,3} have
its constructors private and/or disabled.

http://codereview.appspot.com/157750043

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings



reply via email to

[Prev in Thread] Current Thread [Next in Thread]