CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 20

Threaded View

  1. #4
    Join Date
    Apr 2004
    Location
    In the back seat of New Horizons.
    Posts
    1,238

    Re: Template question...

    Quote Originally Posted by Gabriel Fleseriu
    Ummm...I'd rather explicitely resolve the scope in this case (that is prefix with std:: as needed) because the code above is likely to reside in a header. The 'using' bloats 'list' into the global namespace, which I find rather unpretty.

    @YSG:
    Code:
    ...
    while((curr != stop) && ((* curr) < item))
    ...
    Who is 'stop' ? You mean 'end', don't you?
    Ahh... that's right, thanks dude . I'll just post all of my source files as well as the error output, it should give a better view of what I'm trying to do.

    Errors:
    Code:
    In file included from prg6_3.cpp:6:
    list1.hpp:5: error: parse error before `>' token
    list1.hpp: In function `void insert_order(...)':
    list1.hpp:8: error: parse error before `>' token
    list1.hpp:9: error: parse error before `>' token
    list1.hpp: At global scope:
    list1.hpp:22: error: parse error before `>' token
    list1.hpp: In function `void remove_duplicates(...)':
    list1.hpp:27: error: parse error before `>' token
    list1.hpp:28: error: parse error before `>' token
    In file included from prg6_3.cpp:7:
    util.hpp: At global scope:
    util.hpp:5: error: parse error before `&' token
    util.hpp: In function `void write_list(...)':
    util.hpp:7: error: parse error before `>' token
    prg6_3.cpp: In function `int main()':
    prg6_3.cpp:21: error: no matching function for call to `insert_order(
       std::list<int, std::allocator<int> >&, int&)'
    prg6_3.cpp:26: error: no matching function for call to `write_list(
       std::list<int, std::allocator<int> >&)'
    prg6_3.cpp:29: error: no matching function for call to `remove_duplicates(
       std::list<int, std::allocator<int> >&)'
    prg6_3.cpp:33: error: no matching function for call to `write_list(
       std::list<int, std::allocator<int> >&)'
    Attached Files Attached Files
    Here are the rules, you must obey them or the gender bender will get you.

    And if you ever think of posting without code-tags, the evil monkey will come after you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured