Results 1 to 3 of 3

Thread: Exists any method to move data into STL::MAPS ???

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Exists any method to move data into STL::MAPS ???

    I'd want a method to 'move' map data (data or blocks of data ):

    I' d like a function like this :
    map_move origin, numberof rows , new_pos
    When I use this function I have a new empty space at a known position.

    I have :

    map[0][0 to n]
    map[1][0 to n]
    map [2][0 to n ]

    I want to insert a new value at 1, so I want :

    map[0][0 to n] old map 0
    map[1][0 to n] empty new data
    map [2][0 to n ] (old map 1
    map [3][0 to n ] (old map 2

    Is there something like this ? Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Exists any method to move data into STL::MAPS ???

    based on your example you don't need a map but a set, list or vector.
    Map is key based, and if you insert an entry for an already existing key, the entry will be overwritten.
    Based on your example you need index based container not a key based one.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    tonnot (18th April 2011)

  4. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Exists any method to move data into STL::MAPS ???

    Thank you very much !

Similar Threads

  1. Replies: 13
    Last Post: 6th December 2010, 04:41
  2. Replies: 13
    Last Post: 4th November 2010, 22:34
  3. Replies: 0
    Last Post: 20th July 2010, 18:31
  4. QThread Data Access Method
    By schan117 in forum Qt Programming
    Replies: 7
    Last Post: 18th August 2009, 06:25
  5. Replies: 0
    Last Post: 29th May 2009, 06:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.