title: How to define an enum template (C++20)?
body: <pre><code>enum ByteOrder :uint16_t
  {
      LittleEndian = 0x4949,
      BigEndian = 0x4D4D,
  };
  template&lt;ByteOrder BO&gt;
  enum SF :uint16_t;
  template&lt;&gt;
  enum SF&lt;LittleEndian&gt;
  {
      SF_A = 0x0001;
  };
  template&lt;&gt;
  enum SF&lt;BigEndian&gt;
  {
      SF_A = 0x0100;
  };
  </code></pre>
  <p>Code above is to define an enum template that can adapt itself between 2 different byte orders. However, the compiler says, &quot;An enum template declaration must refer to a previously declared class template member.&quot; What does it mean?</p>
  <p>Is it possible to define an enum template, but requires a special syntax configuration?</p>