title: Conditional move or copy assignment in ternary operator
body: <p>For the following code snippet:</p>
  
  <pre><code>#include &lt;utility&gt;
  #include &lt;iostream&gt;
  
  #define C(name) (name ? name : "nullptr")
  #define PP { std::cout &lt;&lt; __PRETTY_FUNCTION__ &lt;&lt; " : " &lt;&lt; C(name) &lt;&lt; '\n'; }
  #define T { std::cout &lt;&lt; __PRETTY_FUNCTION__ &lt;&lt; " : " &lt;&lt; C(name) &lt;&lt; " -&gt; " &lt;&lt; C(rhs.name) &lt;&lt; '\n'; }
  
  struct A
  {
      const char * name = nullptr;
      A(const char * name) : name{name} PP
      A(A &amp;&amp; rhs) : name{std::exchange(rhs.name, nullptr)} PP
      A(const A &amp; rhs) : name{rhs.name} PP
      A &amp; operator = (A &amp;&amp; rhs) { T; std::swap(name, rhs.name); return *this; }
      A &amp; operator = (const A &amp;&amp; rhs) { T; name = rhs.name; return *this; }
      ~A() PP
  };
  
  #include &lt;random&gt;
  
  int main()
  {
      std::random_device d;
      A a{"a"};
      A b{"b"};
      A c{"c"};
      std::cout &lt;&lt; "begin\n";
      a = ((d() % 2) == 0) ? b : std::move(c);
      std::cout &lt;&lt; "end\n";
  }
  </code></pre>
  
  <p>there are possible two following outputs:</p>
  
  <pre><code>A::A(const char*) : a
  A::A(const char*) : b
  A::A(const char*) : c
  begin
  A::A(A&amp;&amp;) : c
  A&amp; A::operator=(A&amp;&amp;) : a -&gt; c
  A::~A() : a
  end
  A::~A() : nullptr
  A::~A() : b
  A::~A() : c
  </code></pre>
  
  <p>and</p>
  
  <pre><code>A::A(const char*) : a
  A::A(const char*) : b
  A::A(const char*) : c
  begin
  A::A(const A&amp;) : b
  A&amp; A::operator=(A&amp;&amp;) : a -&gt; b
  A::~A() : a
  end
  A::~A() : c
  A::~A() : b
  A::~A() : b
  </code></pre>
  
  <p>Is it possible (according to the Standard) for the compiler to avoid using of temporary value during copy/move assignment with ternary operator in the above case and dispatch to copy or move assignment operator to assign the value of right hand side (<code>b</code> or <code>c</code>) directly to left hand side (<code>a</code>) depending on a condition?</p>