Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. QRegularExpression ?
Forum Updated to NodeBB v4.3 + New Features

QRegularExpression ?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
6 Posts 4 Posters 1.6k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    What is the reason for getting this "warning"?
    What is so special about NOT creating g temporary objects ?
    match is in function, hence already temporary...

    28d7ae8f-18e9-4f9f-9c86-f1f8823208f3-image.png

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      This warning is not about matching, it's about the regex object. Constructing it is expensive, so recommendation is to create it once and reuse rather than recreate a temporary every time you use it.

      A 1 Reply Last reply
      3
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • Chris KawaC Chris Kawa

          This warning is not about matching, it's about the regex object. Constructing it is expensive, so recommendation is to create it once and reuse rather than recreate a temporary every time you use it.

          A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by
          #4

          @Chris-Kawa That is fair, however adding such warning in raw code , before the code is compiled and not in common "warnings" seems overkill. It seems to be a trendy things for "code developers" to do - holding us poor coders hands....
          Cheers
          CLOSED

          Christian EhrlicherC Chris KawaC 2 Replies Last reply
          0
          • A Anonymous_Banned275

            @Chris-Kawa That is fair, however adding such warning in raw code , before the code is compiled and not in common "warnings" seems overkill. It seems to be a trendy things for "code developers" to do - holding us poor coders hands....
            Cheers
            CLOSED

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @AnneRanch said in QRegularExpression ?:

            It seems to be a trendy things for "code developers" to do - holding us poor coders hands....

            You can simply disable the clazy code warnings in QtCreator if you don't want them. But blaming others is much easier...

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            2
            • A Anonymous_Banned275

              @Chris-Kawa That is fair, however adding such warning in raw code , before the code is compiled and not in common "warnings" seems overkill. It seems to be a trendy things for "code developers" to do - holding us poor coders hands....
              Cheers
              CLOSED

              Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @AnneRanch said:

              holding us poor coders hands....

              I mean... you did write that code so... maybe it's useful after all? ;)

              In any case clazy is just another tool to help you write better code, like sanitizers, debuggers, static analyzers etc.
              A lot of people find those useful. Like Christian said you can disable it if you feel you don't need it.

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved