title: C preprocessor insert/append token in string literal
body: <p>I have the following macro:</p>
  
  <pre><code>#define ASSERT_ITERATOR_VALUE_TYPE(Iterator__, Value_type__)                      \
  static_assert(std::is_same&lt;Value_type__, typename Iterator__::value_type&gt;::value, \
                "Expected iterator with value type #Value_type__")
  </code></pre>
  
  <p>In the macro above I'm trying to insert/append the <code>Value_type__</code> token in the string literal that's feed in as the second input argument in <code>static_assert</code>. </p>
  
  <p>Obviously, this is not what I'm trying to achieve, since if I state the macro as:</p>
  
  <pre><code>ASSERT_ITERATOR_VALUE_TYPE(std::set&lt;int&gt;::iterator, double);
  </code></pre>
  
  <p>I'll get the message:</p>
  
  <pre><code>error: static assertion failed: Expected iterator with value type #Value_type__
                                                                    ^^^^^^^^^^^^^
  </code></pre>
  
  <p>where instead I would like to take the message:</p>
  
  <pre><code>error: static assertion failed: Expected iterator with value type double
                                                                    ^^^^^^
  </code></pre>
  
  <p><a href="http://coliru.stacked-crooked.com/a/697a7c37f2ae8fb0" rel="nofollow noreferrer"><strong>Live Demo</strong></a></p>
  
  <h2>Q</h2>
  
  <p>Is there some kind of preprocessor sorcery that will help me achieve what I wan't?</p>