Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Does qmake function unique preserves order of values?

Does qmake function unique preserves order of values?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 802 Views 1 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
    Alexey
    wrote on last edited by
    #1

    Hi,

    @
    ARGS = 1 2 3 2 5 1
    ARGS = $$unique(ARGS) #1 2 3 5
    @

    Does this function preserves order of values in ARGS? For example, may it return 5 3 2 1 ?

    Thank you!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Why not simply test it ?

      Currently, the order follows what the is found from left to right.

      So having
      @
      ARGS = 5 2 1 2 5 3
      ARGS = $$unique(ARGS)
      @

      Will return 5 2 1 3

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Alexey
        wrote on last edited by
        #3

        I've tested. But test doesn't guarantee anything. I want to be sure before commiting it into production code.

        1 Reply Last reply
        0

        • Login

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