Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Custom collections

Custom collections

Scheduled Pinned Locked Moved Managed C++/CLI
questioncsharpc++data-structurescryptography
2 Posts 2 Posters 7 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.
  • S Offline
    S Offline
    sultan_of_6string
    wrote on last edited by
    #1

    Hi! The .NET collection classes have me pissed off. Being a C++ kinda guy, I love linked lists and I find the dynamic arrays to be really inane. So, I'm creating my own linked list class. I'm having some trouble with the enumerator: An IEnumerator interface to an IEnumerable object is valid so long as IEnumerable wasn't modified after IEnumerator was created. How do I let my IEnumerator class know that my IEnumerable was modified? I don't want to use a DateTime/TimeSpan class. I was thinking of incrementing an integer everytime the list is modified and making that the hash code. the IEnumerator could store the hashcode when it was created and compare it to the current hashcode. However, with extensive use, this procedure may not work. Any suggestions?

    J 1 Reply Last reply
    0
    • S sultan_of_6string

      Hi! The .NET collection classes have me pissed off. Being a C++ kinda guy, I love linked lists and I find the dynamic arrays to be really inane. So, I'm creating my own linked list class. I'm having some trouble with the enumerator: An IEnumerator interface to an IEnumerable object is valid so long as IEnumerable wasn't modified after IEnumerator was created. How do I let my IEnumerator class know that my IEnumerable was modified? I don't want to use a DateTime/TimeSpan class. I was thinking of incrementing an integer everytime the list is modified and making that the hash code. the IEnumerator could store the hashcode when it was created and compare it to the current hashcode. However, with extensive use, this procedure may not work. Any suggestions?

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      Refer to Nish's excellent article on implementing collections in MC++. He uses one possible solution (flag to say if it is modified). James "Java is free - and worth every penny." - Christian Graus

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups