Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-111598

Implement get/get_if for QVariant to make it nicer for non-default constructible types

    XMLWordPrintable

Details

    • All
    • 8
    • fd17eaca8 (dev), 21615e8df (tqtc/lts-6.2), b95564822 (dev), 28f56f29b (dev), 7f0a919f4 (tqtc/lts-6.2), b00690030 (tqtc/lts-5.15), 6cc1b01ac (6.5), fa510dab9 (6.4), 133be162c (6.5), eb9c8042c (dev), a1889b2a6 (dev), de3e97088 (dev), 690761a4a (dev)
    • Foundation Sprint 77, Foundation Sprint 78

    Description

      QVariant::fromValue<T>() only requires that T is copy-constructible type, but QVariant::value() requires default constructor.

      This asymmetric usage is error prone and it would be best to support non-default constructible type with QVariant::value().
      If it is not possible, QVariant::fromValue() should be ill-formed for non-default-constructible types.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mmutz Marc Mutz
              xylosper Byoung-young Lee
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: