title: define function template alias by using
body: <p>I define a function template alias:</p>
  
  <pre><code>template &lt;typename T&gt;
  using Cb = typename std::add_pointer&lt;void(bool, T)&gt;::type;
  </code></pre>
  
  <p>but got this error : </p>
  
  <blockquote>
    <p>error: cannot convert 'Log::operator()(Read&amp;) [with T = int]::' to 'Cb' {aka 'void (*)(bool, int)'} in assignment</p>
  </blockquote>
  
  <pre><code>template &lt;typename T&gt;
  class Log : public Sink&lt;T&gt; {
  public:
      void
      operator()(Read&lt;T&gt; &amp;read) {
          if (!more_) {
              // error !!!
              more_ = std::function&lt;Cb&lt;T&gt;&gt;([&amp;](bool done, T val) {
                  if (!done) {
                      cout &lt;&lt; val &lt;&lt; endl;
                      this-&gt;operator()(read);
                  }
              });
          }
          read(false, more_);
      }
  
  private:
      Cb&lt;T&gt; more_ = nullptr;
  };
  </code></pre>
  
  <p>main function:</p>
  
  <pre><code>int main() {
  
      Log&lt;int&gt; logInt;
  
      return 0;
  }
  </code></pre>
  
  <p>who to resolve this syntax error?</p>
  
  <p><a href="http://coliru.stacked-crooked.com/a/d8d76f665ea07898" rel="nofollow noreferrer">code example</a></p>