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. Is it possible to use static arrays in std Algorithms?
Forum Updated to NodeBB v4.3 + New Features

Is it possible to use static arrays in std Algorithms?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
6 Posts 5 Posters 1.5k Views 2 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.
  • E Offline
    E Offline
    Engelard
    wrote on 16 Nov 2018, 19:42 last edited by Engelard
    #1

    I've used always dynamic(vectors) in such functions like std::search(); or std::sort();, in all examples only vectors, so i'v started to assuming that only dynamic array is allowed.

    But now i want to use simple-raw-default array, but don't know how do that properly, and maybe that approach is not safe. There is simply no ability to use functions from array like .begin()/.end().

    K 1 Reply Last reply 16 Nov 2018, 19:47
    0
    • E Engelard
      16 Nov 2018, 19:42

      I've used always dynamic(vectors) in such functions like std::search(); or std::sort();, in all examples only vectors, so i'v started to assuming that only dynamic array is allowed.

      But now i want to use simple-raw-default array, but don't know how do that properly, and maybe that approach is not safe. There is simply no ability to use functions from array like .begin()/.end().

      K Offline
      K Offline
      koahnig
      wrote on 16 Nov 2018, 19:47 last edited by
      #2

      @Engelard

      This question has no relation to Qt.

      However, pick your choice.

      Vote the answer(s) that helped you to solve your issue(s)

      E J 2 Replies Last reply 16 Nov 2018, 20:43
      3
      • K koahnig
        16 Nov 2018, 19:47

        @Engelard

        This question has no relation to Qt.

        However, pick your choice.

        E Offline
        E Offline
        Engelard
        wrote on 16 Nov 2018, 20:43 last edited by Engelard
        #3

        @koahnig said in Is it possible to use static arrays in std Algorithms?:

        This question has no relation to Qt.

        I really can't understand point of "C++" group here, thought it for C++ in general.

        Tnx for the link, from it i gain that easier would be just create temporary vector and pass my static array as parameter.

        M 1 Reply Last reply 17 Nov 2018, 21:40
        0
        • E Engelard
          16 Nov 2018, 20:43

          @koahnig said in Is it possible to use static arrays in std Algorithms?:

          This question has no relation to Qt.

          I really can't understand point of "C++" group here, thought it for C++ in general.

          Tnx for the link, from it i gain that easier would be just create temporary vector and pass my static array as parameter.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 17 Nov 2018, 21:40 last edited by
          #4

          @Engelard
          Hi
          Maybe you can use std::array instead ?

          1 Reply Last reply
          0
          • K koahnig
            16 Nov 2018, 19:47

            @Engelard

            This question has no relation to Qt.

            However, pick your choice.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 19 Nov 2018, 07:17 last edited by
            #5

            @koahnig This is "C++ Gurus" forum, I guess it is fine to ask here pure C++ questions without Qt relation?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • V Offline
              V Offline
              VRonin
              wrote on 20 Nov 2018, 17:09 last edited by
              #6

              To summarise: std::begin() and std::end() are the way to go

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              1 Reply Last reply
              1

              1/6

              16 Nov 2018, 19:42

              • Login

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