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. C++ named parameters?
Forum Update on Monday, May 27th 2025

C++ named parameters?

Scheduled Pinned Locked Moved Solved C++ Gurus
4 Posts 2 Posters 518 Views
  • 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.
  • J Offline
    J Offline
    JonB
    wrote on 18 May 2024, 07:32 last edited by
    #1

    Browsing woboq (my only resource for Qt source code) I came across many occurrences such as https://codebrowser.dev/qt5/qtbase/src/corelib/io/qprocess_unix.cpp.html#713
    Screenshot 2024-05-18 082443.png

    And I thought to myself: "Wot? Named parameters?!". Since what version of C++??

    Then I tried to copy/paste that line to post here, and found it shows as:
    Screenshot 2024-05-18 082738.png

    So the plot thickens! Clearly the source code is not really as shown, it does not actually have the "named parameters" in it, right? So this is some woboq-ism on presentation to confuse the gullible? What's going on?

    P 1 Reply Last reply 18 May 2024, 11:54
    0
    • J JonB
      18 May 2024, 07:32

      Browsing woboq (my only resource for Qt source code) I came across many occurrences such as https://codebrowser.dev/qt5/qtbase/src/corelib/io/qprocess_unix.cpp.html#713
      Screenshot 2024-05-18 082443.png

      And I thought to myself: "Wot? Named parameters?!". Since what version of C++??

      Then I tried to copy/paste that line to post here, and found it shows as:
      Screenshot 2024-05-18 082738.png

      So the plot thickens! Clearly the source code is not really as shown, it does not actually have the "named parameters" in it, right? So this is some woboq-ism on presentation to confuse the gullible? What's going on?

      P Online
      P Online
      Pl45m4
      wrote on 18 May 2024, 11:54 last edited by
      #2

      @JonB

      You may find your solution here
      (haven't checked all of it)

      • https://woboq.com/blog/codebrowser-under-the-hood.html
      • https://woboq.com/blog/codebrowser-introduction.html

      I think it's a woboq code browser feature.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      J 1 Reply Last reply 18 May 2024, 12:22
      1
      • P Pl45m4
        18 May 2024, 11:54

        @JonB

        You may find your solution here
        (haven't checked all of it)

        • https://woboq.com/blog/codebrowser-under-the-hood.html
        • https://woboq.com/blog/codebrowser-introduction.html

        I think it's a woboq code browser feature.

        J Offline
        J Offline
        JonB
        wrote on 18 May 2024, 12:22 last edited by
        #3

        @Pl45m4
        Didn't notice my specific feature in their links, but as you say it will be some annotation they add. I thought I (C++) was going mad! I have used woboq many times on many other Qt source files without seeing this aspect.

        P 1 Reply Last reply 18 May 2024, 13:37
        0
        • J JonB
          18 May 2024, 12:22

          @Pl45m4
          Didn't notice my specific feature in their links, but as you say it will be some annotation they add. I thought I (C++) was going mad! I have used woboq many times on many other Qt source files without seeing this aspect.

          P Online
          P Online
          Pl45m4
          wrote on 18 May 2024, 13:37 last edited by Pl45m4
          #4

          @JonB

          I think it's some kind of hint for the reader to understand the source code better without browsing the whole class.
          Like:

          in some class.h where someFunction(int a, int b, float c) is declared

          void someFunction(int a, int b, float c);
          

          and (if I'm correct) everywhere the function is used, on every call, the code browser adds the names from the header, so you know right away what this

          // some code
          // ...
          someFunction(42, 42, 13.37);
          // ...
          

          means.

          With the hint it looks like:
          ( imagine meaningful names there :D )

          someFunction( [ a ]: 42, [ b ]: 42, [ c ]: 13.37);
          

          Therefore I don't think it's C++ :)
          Btw: I also like woboq to check Qt source code :)


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          0
          • J JonB has marked this topic as solved on 18 May 2024, 17:51

          4/4

          18 May 2024, 13:37

          • Login

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