Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to add "default" and "delete" to methods?
How to add "default" and "delete" to methods? [message #1842900] Mon, 05 July 2021 17:15 Go to next message
Manuel Malagon is currently offline Manuel MalagonFriend
Messages: 81
Registered: December 2011
Member
I'm creating a singleton and I need the following to be generated:

Main.h
class Main
{
public:

    /**
     * 
     * @return  
     */
    static Main& getInstance();

    /**
     * 
     * @param obj 
     */
    Main(const Main & /*in*/obj) = delete;

    /**
     * 
     * @param obj 
     */
    void operator =(const Main & /*in*/obj) = delete;

private:

    /**
     * 
     */
    void Main();
};


But the problem is that I don't know how to add the = delete to the copy constructor and the assignment operator.

How is this done?
Re: How to add "default" and "delete" to methods? [message #1842967 is a reply to message #1842900] Thu, 08 July 2021 07:54 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi Manuel,

this is currently not supported. Can you please post a bug with severity = Enhancement.
Re: How to add "default" and "delete" to methods? [message #1843006 is a reply to message #1842967] Sat, 10 July 2021 16:26 Go to previous message
Manuel Malagon is currently offline Manuel MalagonFriend
Messages: 81
Registered: December 2011
Member
Ansgar,

Thanks for the reply, I have created the bug here https://bugs.eclipse.org/bugs/show_bug.cgi?id=574783
Previous Topic:{xor} constraint
Next Topic:Issues with default and copy constructor when CDT editor opened
Goto Forum:
  


Current Time: Thu Apr 25 06:56:29 GMT 2024

Powered by FUDForum. Page generated in 0.02770 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top