[PATCH] D24686: [support] Some improvements to StringSwitch

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 11:07:14 PDT 2016


zturner added a comment.

I don't think that will work.

In https://reviews.llvm.org/D24686#559270, @ruiu wrote:

> I wonder if we need `OrNone`. Isn't it equivalent to `.Default(None)`?


It works if we add an additional overload of `Default()` like this:

  Optional<R> Default(llvm::NoneType N) const {
    if (Result)
      return *Result;
    return None;
  }

If people prefer that I can go with that instead of `OrNone`


https://reviews.llvm.org/D24686





More information about the llvm-commits mailing list