Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-24216

Add static factory function to Duration that does not throw

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      Ex:

      int ms = 12341234;
      auto millis = representAs<Milliseconds>(ms);
       
      // use case I want:
      fn( representAs<Milliseconds>(userInputMs).value_or(Milliseconds::max()) );
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: