Implement makeStatusWith<T> factory function

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • 3.1.1
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • Platform 1 04/03/15
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This would be analogous to std::make_unique/make_shared/make_optional

      There would be two overloads - one that takes a variadic pack and forwards it to T's constructor, returning an engaged StatusWith<T>.

      The second would take an errorCode and return a disengaged StatusWith<T>.

      This would make it possible to write:

      return makeStatusWith<StringData>{str, len};
      

      instead of:

      return StatusWith<StringData>{StringData{str, len}};
      

      Tack on work: add an of overload uassertStatusOK that takes a StatusWith<T>

            Assignee:
            Adam Midvidy (Inactive)
            Reporter:
            Adam Midvidy (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: