On 16/03/17 00:43 +0200, Ville Voutilainen wrote:
On 16 March 2017 at 00:31, Jonathan Wakely <jwak...@redhat.com> wrote:
      emplace(_Args&&... __args)
      {
        __do_emplace<_Decay<_ValueType>>
          (std::forward<_Args>(__args)...);
+       return *(std::any_cast<_Decay<_ValueType>>(this));


Can we avoid the branch in any_cast to check the stored type?
We know it's the right type, because we just stored it.

While I would hope the compiler to be smart enough to realize some of
that (we are passing in
this), the other branches might not be so easy. But certainly, we can
axe every one of the extraneous
branches, like in the attached amendment.

And then we don't need the forward declarations of any and any_ast,
right?

OK for trunk like that, thanks.


Reply via email to