summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy/checks/readability-deleted-default.rst
blob: 2fb87cb261f470d039ea2dff133cc9f98b38b822 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.. title:: clang-tidy - readability-deleted-default

readability-deleted-default
===========================

Checks that constructors and assignment operators marked as ``= default`` are
not actually deleted by the compiler.

.. code:: c++

  class Example {
  public:
    // This constructor is deleted because I is missing a default value.
    Example() = default;
    // This is fine.
    Example(const Example& Other) = default;
    // This operator is deleted because I cannot be assigned (it is const).
    Example& operator=(const Example& Other) = default;
  private:
    const int I;
  };

OpenPOWER on IntegriCloud