• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: problem using std::remove
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem using std::remove


  • Subject: Re: problem using std::remove
  • From: Ryan Wilcox <email@hidden>
  • Date: Tue, 22 Jun 2004 09:30:26 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 6/21/04, at 7:34 PM, Kaveh Kardan said:

>I have the following piece of code:
>
>std::remove(vec.begin(), vec.end(), 3);
>
>and complains of a type mismatch:
>
>bzList.cpp:86: error: cannot convert
>`__gnu_cxx::__normal_iterator<int*, std::vector<int,
>std::allocator<int> > >' to `const char*' for argument `1' to `int
>remove(const char*)'

XCode-Users isn't exactly the list to get help on programming questions - just
questions on Apple's Integrated Development Environment called XCode.
(read: "hey, how do I turn on line numbers with XCode?" vs "hey, how do I fix
this error in my code (or, "how do I make this kind of application"). For the
latter type of questions, see Apple's Cocoa-Dev list (<http://lists.apple.com>),
or Omnigroup's Mac OSX-Dev (<http://www.omnigroup.com/developer/mailinglists/>).
Or in this case a good C++ newbies newsgroup or mailing list.

The answer to your question, I think, is that it doesn't really make sense (so
the compiler is right). remove() will remove a directory entry (  remove ( const
char* path )  ). It looks to me like you want to do something completely
different (like remove items in the vector? I can't guess). Unless you really
*do* have a vector<char*> there, but if you do, why not use std::string?

Perhaps using another member function of vector will do what you want.

Hope this helps,
_Ryan Wilcox

================================================================
Wilcox Development Solutions:          http://www.wilcoxd.com
Toolsmiths for the Internet Age            PGP: 0x2F4E9C31

-----BEGIN PGP SIGNATURE-----
Version: PGP SDK 3.0.3

iQA/AwUBQNg0b22DtKgvTpwxEQIcvQCg/N16DhzjL2BmToprvFT10lTM4K4AoMUf
6yZeRPasvXmvhZYdSC0aB3Yd
=Hi9Q
-----END PGP SIGNATURE-----
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >problem using std::remove (From: Kaveh Kardan <email@hidden>)

  • Prev by Date: problem using std::remove
  • Next by Date: Re: problem using std::remove
  • Previous by thread: problem using std::remove
  • Next by thread: Re: problem using std::remove
  • Index(es):
    • Date
    • Thread