title: C++ can't implement default constructor
body: <p>I have the following class:</p>
  
  <pre><code>class Fraction {
      private:
          int x;
          int y;
      public:
      // Constructors
          Fraction(long x = 0, long y = 1);
          Fraction(const Fraction&amp;)=default;//here is the problem
          virtual ~Fraction();
   };
  </code></pre>
  
  <p>I'm trying to disable default C++ constructor to implement my own (I intend to use it for copy). So, I declared it as a default. But, when I'm trying to implement it:</p>
  
  <pre><code>Fraction::Fraction(const Fraction&amp;){}
  </code></pre>
  
  <p>Compiler throws the following error at me:</p>
  
  <blockquote>
    <p>./src/Fraction.cpp:16:1: error: definition of explicitly-defaulted
    ‘Fraction::Fraction(const Fraction&amp;)’  Fraction::Fraction(const
    Fraction&amp;){  ^ In file included from ../src/Fraction.cpp:8:0:
    ../src/Fraction.h:22:2: error: ‘Fraction::Fraction(const Fraction&amp;)’
    explicitly defaulted here   Fraction(const Fraction&amp;)=default;</p>
  </blockquote>
  
  <p>Is there any way to fix it? What I'm doing wrong ? I found some articles about defaults, but nothing that can help me fix these errors.</p>