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. A question about STL C++?
Forum Updated to NodeBB v4.3 + New Features

A question about STL C++?

Scheduled Pinned Locked Moved C++ Gurus
4 Posts 2 Posters 1.9k 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.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

    we need to use backin_serter and front_inserter with the algorithms
    that removes or copy elements like copy,remove_copy because they can't change the size of containers only elements
    but why we don't use it with transform? even though it changes the size of the reciever container

    1 Reply Last reply
    0
    • JohanSoloJ Offline
      JohanSoloJ Offline
      JohanSolo
      wrote on last edited by JohanSolo
      #2

      AFAIK std::transform cannot change the size of the output container, have a look at"the doc: the output container must have the same size as the input one. To be more specific, the output container must have the same size as the processed input range, which can be different from the size of the input container.

      `They did not know it was impossible, so they did it.'
      -- Mark Twain

      1 Reply Last reply
      0
      • ? This user is from outside of this forum
        ? This user is from outside of this forum
        Guest
        wrote on last edited by
        #3

        yes thanks i think i missed that

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bipll
          wrote on last edited by
          #4

          http://ideone.com/N3lJaS

          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