• 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: C++ std::string tries to free() a not allocated pointer ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ std::string tries to free() a not allocated pointer ?


  • Subject: Re: C++ std::string tries to free() a not allocated pointer ?
  • From: Robert Schwalbe <email@hidden>
  • Date: Thu, 19 Nov 2009 09:25:04 -0500

The class does have a copy constructor. It actually has several. I omitted them because I didn't think they were relevant. I still don't think they are. Here they are:

		const SQLString & operator=(const char * s)
		{
			realStr = s;
			return *this;
		}

		const SQLString & operator=(const std::string & rhs)
		{
			realStr = rhs;
			return *this;
		}

		const SQLString & operator=(const SQLString & rhs)
		{
			realStr = rhs.realStr;
			return *this;
		}


While I am not a C++ language lawyer, I will contend that the above
are three different assignment operators (i.e. not copy constructors).

A copy constructor would have the following signature:

SQLString:: SQLString(const SQLString &inSQLString)
{
	realStr = inSQLString.realStr;
}

(If you were privy to the pre-edited version of this message, please ignore).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: C++ std::string tries to free() a not allocated pointer ?
      • From: Robert Schwalbe <email@hidden>
    • Re: C++ std::string tries to free() a not allocated pointer ?
      • From: Jean-Denis Muys <email@hidden>
    • Re: C++ std::string tries to free() a not allocated pointer ?
      • From: Robert Schwalbe <email@hidden>
  • Prev by Date: Re: Project templates & encoding
  • Next by Date: Re: C++ std::string tries to free() a not allocated pointer ?
  • Previous by thread: Re: C++ std::string tries to free() a not allocated pointer ?
  • Next by thread: Re: C++ std::string tries to free() a not allocated pointer ?
  • Index(es):
    • Date
    • Thread