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. ATL / WTL / STL
  4. set compiler error

set compiler error

Scheduled Pinned Locked Moved ATL / WTL / STL
helpquestion
2 Posts 2 Posters 13 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.
  • _ Offline
    _ Offline
    _Magnus_
    wrote on last edited by
    #1

    Can anyone explain why i have to use a namespace specifier in the code below?

    #include <set>
    using std::set;

    class myclass
    {
    ...
    set<CString,strcmpfn> myset; // no problem
    ...

    myfunc()
    {
    ...
    // this gives a compile error, have to be std::set
    set<CString, strcmpfn>::iterator it = myset.find(szPath);
    ...
    }
    };

    /Magnus


    - I don't necessarily agree with everything I say

    M 1 Reply Last reply
    0
    • _ _Magnus_

      Can anyone explain why i have to use a namespace specifier in the code below?

      #include <set>
      using std::set;

      class myclass
      {
      ...
      set<CString,strcmpfn> myset; // no problem
      ...

      myfunc()
      {
      ...
      // this gives a compile error, have to be std::set
      set<CString, strcmpfn>::iterator it = myset.find(szPath);
      ...
      }
      };

      /Magnus


      - I don't necessarily agree with everything I say

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Add using std::set::iterator; --Mike-- Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm

      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