tassert() should use operator bool()

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Internal Code
    • Fully Compatible
    • Query Execution 2021-03-22
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Let's say I have a boost::optional<T>. I would like to be able to write the following:

      boost::optional<T> myT = getT();
      tassert(1234500, "expected a non-none T", myT);
      

      However, today I have to write either

      tassert(1234500, "expected a non-none T", static_cast<bool>(myT));
      

      or

      tassert(1234500, "expected a non-none T", myT.has_value());
      

            Assignee:
            Yoon Soo Kim (Inactive)
            Reporter:
            David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: