title: Function parameter with unknown value cannot be used in a constant expression
body: <p>Why I get compilation error &quot;function parameter 'field' with unknown value cannot be used in a constant expression&quot;?</p>
  <p>All marked as constexpr, I don't see any problems with knowing value at compile time.</p>
  <p>Is there any way to fix this error?</p>
  <pre><code>#include &lt;tuple&gt;
  #include &lt;string_view&gt;
  
  namespace {
    template&lt;typename Tuple, typename F, std::size_t... Indices&gt;
    constexpr void for_each_impl(Tuple &amp;&amp;tuple, F &amp;&amp;f, std::index_sequence&lt;Indices...&gt;) {
      (f(std::get&lt;Indices&gt;(std::forward&lt;Tuple&gt;(tuple))), ...);
    }
  
    template&lt;typename Tuple, typename F&gt;
    constexpr void for_each(Tuple &amp;&amp;tuple, F &amp;&amp;f) {
      const auto N = std::tuple_size&lt;std::remove_reference_t&lt;Tuple&gt;&gt;::value;
      for_each_impl(std::forward&lt;Tuple&gt;(tuple), std::forward&lt;F&gt;(f), std::make_index_sequence&lt;N&gt;{});
    }
  
    template &lt;typename T, typename... Tuple&gt;
    constexpr auto has_type(const std::tuple&lt;Tuple...&gt; &amp;tuple) {
      return std::disjunction_v&lt;std::is_same&lt;T, Tuple&gt;...&gt;;
    }
  }// namespace
  
  template&lt;typename A&gt;
  struct meta_field {
    constexpr meta_field(std::string_view name, A attributes)
      : name(name), attributes(attributes) {
    }
  
    const std::string_view name;
    const A attributes;
  };
  
  int main() {
    constexpr auto fields = std::make_tuple(meta_field(&quot;a121213&quot;, std::make_tuple(int(5))), meta_field(&quot;hello&quot;, std::make_tuple()));
  
    for_each(fields, [](const auto &amp;field) {
      // why unknown value?
      if constexpr (has_type&lt;int&gt;(field.attributes)) {
        
      }
    });
  }
  </code></pre>
  <p><a href="https://godbolt.org/z/4ej6b6" rel="nofollow noreferrer">Godbold link</a></p>