title: Is it illegal to invoke a std::function<void(Args...)> under the standard?
body: <p>All quotes are from <a href="https://isocpp.org/files/papers/N3797.pdf">N3797</a>.</p>
  
  <p><strong>4/3 [conv]</strong></p>
  
  <blockquote>
    <p>An expression
    e
    can be
    implicitly converted
    to a type
    T
    if and only if the declaration
    T t=e;
    is well-formed,
    for some invented temporary variable
    t</p>
  </blockquote>
  
  <p>This implies no expression can be implicitly converted to <code>void</code>, as <code>void t=e</code> is illegal for all expressions <code>e</code>.  This is even true if <code>e</code> is an expression of type <code>void</code>, such as <code>void(3)</code>.</p>
  
  <p>So an expression of type <code>void</code> cannot be implicitly converted to <code>void</code>.</p>
  
  <p>Which leads us to:</p>
  
  <p><strong>20.9.2/2 Requirements [func.require]</strong></p>
  
  <blockquote>
    <p>Define
    INVOKE
    (f, t1, t2, ..., tN, R)
    as
    INVOKE
    (f, t1, t2, ..., tN)
    implicitly converted to
    R
    .</p>
  </blockquote>
  
  <p>In short, <code>INVOKE(f, t1, t2, ..., tN, R)</code> is never valid when <code>R</code> is <code>void</code>, as nothing (including <code>void</code>) can be implicitly converted to <code>void</code>.</p>
  
  <p>As a result of this, all <code>std::function&lt;void(Args...)&gt;</code> have the property <code>!*this</code> and thus cannot be called, as the only constructors that do not have <code>!*this</code> as a postcondition (or do not copy such state from another <code>function</code> of the same type) require <code>Callable</code> of one of the parameters.</p>
  
  <p><strong>20.9.11.2/7 Class template
  function
  [func.wrap.func]</strong></p>
  
  <blockquote>
    <p>Requires:
    F
    shall be
    CopyConstructible
    .
    f
    shall be Callable (
    20.9.11.2
    ) for argument types
    ArgTypes
    and return type
    R
    . The copy constructor and destructor of
    A
    shall not throw exceptions.</p>
  </blockquote>
  
  <p><strong>20.9.11.2/2 Class template
  function
  [func.wrap.func]</strong></p>
  
  <blockquote>
    <p>A callable object
    f
    of type
    F
    is
    Callable
    for argument types
    ArgTypes
    and return type
    R
    if the expres-
    sion
    INVOKE
    (f, declval()..., R)
    , considered as an unevaluated operand (Clause
    5
    ), is well
    formed (
    20.9.2
    ).</p>
  </blockquote>
  
  <p>As demonstrated above, there are no <code>Callable</code> expressions for <code>std::function&lt;void(Args...)&gt;</code>.</p>
  
  <p>If somehow such a <code>std::function&lt;void(Args...)&gt;</code> where found, invoking <code>operator()</code> would be ill formed:</p>
  
  <p><strong>invocation [func.wrap.func.inv]</strong></p>
  
  <blockquote>
    <p>Effects:
    INVOKE
    (f, std::forward(args)..., R)
    (
    20.9.2
    ), where
    f
    is the target ob-
    ject (
    20.9.1
    ) of
    *this
    .</p>
  </blockquote>
  
  <p>as <code>INVOKE(f, std::forward&lt;ArgTypes&gt;(args)..., void)</code> is ill formed for all arguments and <code>f</code>.</p>
  
  <p>Is this line of reasoning sound?</p>