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

QByteArray needs an additional constructor

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • 4.5.1
    • 6.4.0
    • None
    • Linux e5-2620v2 6.0.1-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 13 Oct 2022 18:58:49 +0000 x86_64 GNU/Linux

    • All

    Description

      We currently have this constructor:

      QByteArray(qsizetype size, char ch)

      This does 2 things: sets an initial size and initializes using ch. This violates the principle of orthogonality, which stipulates a function should do only 1 thing. Therefore I propose an additional constructor:

      QByteArray(qsizetype size)

      that would set an initial size, but perform no initialization.

      Attachments

        For Gerrit Dashboard: QTBUG-107686
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            janezzabc Janez Žemva
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change