title: Check length of string literal at compile time
body: <p>I would like to check length of my string literals at compile time. For now I am thinking about the following construction, but can't complete it:</p>
  
  <pre><code>#define STR(s) (sizeof(s) &lt; 10 ? s : /* somehow perform static_assert */)
  
  void foo(const char* s) {}
  int main() { 
      foo(STR("abc")); // foo("abc")
      foo(STR("abcabcabcabc")); // compile time error: "String exceeds 10 bytes!"
  }
  </code></pre>