title: explicitly defaulted function cannot be declared as constexpr because the implicit declaration is not constexpr
body: <p>I'm trying to compile a C++ library (with gcc 5.3.1-14ubuntu2) and got this type of error:</p>
  
  <pre><code>&gt; In file included from
  &gt; /root/pitchfork/workspace/unanimity/include/pacbio/consensus/ModelConfig.h:49:0,
  &gt;                  from /root/pitchfork/workspace/unanimity/src/models/P6C4NoCovModel.cpp:42:
  &gt; /root/pitchfork/workspace/unanimity/include/pacbio/data/internal/BaseEncoding.h:119:31:
  &gt; error: explicitly defaulted function 'constexpr
  &gt; PacBio::Data::detail::NCBI2na&amp;
  &gt; PacBio::Data::detail::NCBI2na::operator=(const
  &gt; PacBio::Data::detail::NCBI2na&amp;)' cannot be declared as constexpr
  &gt; because the implicit declaration is not constexpr:
  &gt;      inline constexpr NCBI2na&amp; operator=(const NCBI2na&amp;) = default;
  </code></pre>
  
  <p>The part of the code that cause trouble is :</p>
  
  <pre><code>class NCBI2na
  {
  public:
      static inline constexpr NCBI2na FromASCII(const char base) { return NCBI2na{base}; }
      static inline constexpr NCBI2na FromRaw(const uint8_t raw) { return NCBI2na{raw}; }
  
  public:
      ~NCBI2na() = default;
  
      inline constexpr NCBI2na(const NCBI2na&amp;) = default;
      inline constexpr NCBI2na(NCBI2na&amp;&amp;) = default;
  
      inline constexpr NCBI2na&amp; operator=(const NCBI2na&amp;) = default;
      inline constexpr NCBI2na&amp; operator=(NCBI2na&amp;&amp;) = default;    
  };
  </code></pre>
  
  <p>The part of the code that seems to causes trouble is the "= default". This may alos be related </p>
  
  <p>I looked around but could not find a solution to this problem so far.
  Here are some similar questions that could help:</p>
  
  <p><a href="https://stackoverflow.com/questions/46726390/constexpr-defining-static-data-member-of-literal-type-that-is-declared-const">constexpr defining static data member of literal type that is declared const</a>
  <a href="https://stackoverflow.com/questions/34097076/constructor-of-derived-class-cannot-be-constexpr-if-base-class-contains-array-me">constructor of derived class cannot be constexpr if base class contains array member</a></p>