Skip to content

Display the special operations generated by the compiler #224

@viboes

Description

@viboes

It would be great if the tool could show the special operations generated by the compiler as well as the ones requested using default.

struct C { 
  int i; 
};
struct C { 
  int i;
  C() = default; 
  C(C const&) = default; 
  C(C &&) = default; 
  C& operator=(C const&) = default; 
  C& operator=(C &&) = default; 
  ~C() noexcept = default;
};

In addition when the user request the default and the compiler deletes the function as he default generated will be ill formed, the tool could replace =default by =delete.

Before

struct C
{
  int & i;
  C() = default;
  C(const C &) = default;
};

https://cppinsights.io/s/cd13011a

After

struct C
{
  int & i;
  inline C() = delete;
  inline C(const C &) = delete;
};

P.S. I'm not asking to show the generated code, just to show what are the provided operations and which ones are deleted.

This doesn't mean thathaving the option to have the code as well will not be welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions