comp.lang.c++@googlegroups.com | Google Groups | ![]() |
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
- This code shouldn't run. Heck! It shouldn't even compile! - 1 Update
- C++ and Web Services (OT maybe?) - 2 Updates
- Onwards and upwards - 1 Update
- Deleting std::vector Item(s) - 1 Update
- "JetBrains CLion C++ IDE First Impressions" - 2 Updates
- g++ inline behavior - 2 Updates
- knock knock: my self-documenting code pursuit - 2 Updates
DSF <notavalid@address.here>: Oct 02 09:48PM -0400 Hello group! Whilst perusing my string class for another posting, I encountered code that I originally thought was in error. I see now how it is working, but there is still one aspect that puzzles me. That's why this is being posted instead of being dumped into the bit bucket. First, the class (FString, which is a template class) contains, among others, four dual string parameter constructors. One for each permutation of const FString<CH>& and const char *. They construct a string object that is a left-to-right concatenation of the two parameters. template <class CH> class FString { public: // One of four: FString(const FString<CH>& string1, const FString<CH>& string2, bool casesensitive = csdefault); // The + operator is overloaded in the same manner, as in: // One of four: friend const FString<CH> operator+(const FString<CH>& str1, const FString<CH>& str2); }; // Within the class. And outside: template <class CH> const FString<CH> operator+(const FString<CH>& str1, const FString<CH>& str2) { return FString<CH>(str1, str2); } I first thought the error here is that I was calling a constructor to do the concatenation. But I see now I am merely creating an unnamed object. Since the object is returned by value, the scope of the object is no problem, but I'm still left with one puzzler: Constructors are not declared (defined? I always get those two mixed-up!) with a return value. If I recall correctly you are not supposed to use a constructor as an rvalue. (As an aside, I know that every constructor created with my ancient Borland C/C++ 5.xx returns "this". Disassembly proves it. So have I forgotten something and this is legal code, or just something my compiler is allowing? If it's legal, my guess would be that I'm not returning the value of the constructor, but rather a copy of the temporary object the constructor constructed. Thanks for any help, DSF "'Later' is the beginning of what's not to be." D.S. Fiscus |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Oct 02 06:44PM +0100 On 02/10/2014 00:50, Ian Collins wrote: >> REST and SOAP. Where would we start in C++ land without handy IDE code >> generators and frameworks those .NET guys have? > SOAP is just XML, so all you really need is a decent XML library. My C++ XML library "NoFussXML" is the fastest! :) /Flibble |
Ian Collins <ian-news@hotmail.com>: Oct 02 12:50PM +1300 Christopher Pisz wrote: > define my own protocol or XML schema. I understand web services are just > REST and SOAP. Where would we start in C++ land without handy IDE code > generators and frameworks those .NET guys have? SOAP is just XML, so all you really need is a decent XML library. -- Ian Collins |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Oct 02 06:42PM +0100 >> Using Winsock doesn't sound very portable to me. > I believe the asio library also uses Winsock on > Windows. Of course it does and std::thread will also use a Windows thread on Windows so what is your point? boost.asio hides winsock from you so you can write portable code. Another reason to use boost.asio is that it is likely that it will go into next major revision of C++. /Flibble |
Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 01 11:21AM On Wed, 2014-10-01, peter koch wrote: > so I do not know how that idea got stuck in my head. > Perhaps because Mike wrote something like "delete object from a vector"? > Sorry about the noise. If it was noise, it was of a useful kind. Never hurts to remind people what std::remove_if() does and doesn't do! /Jorgen -- // Jorgen Grahn <grahn@ Oo o. . . \X/ snipabacken.se> O o . |
Juha Nieminen <nospam@thanks.invalid>: Sep 29 01:31PM > God is beautiful, and peaceful, and loving, forgiving, patient, tolerant > of our ignorance, kind, helpful, drawing us to Him, desiring to give us > of His vast Kingdom, and more. I find fascinating how religion can cause such a cognitive dissonance. It makes you think like that, and at the same time that the same God has created a place of eternal indescribable torment and torture where he sends his own creation to suffer forever because they didn't love him the right way. If a father tortured his children in a torture cellar he himself built, would you call him "peaceful, loving, forgiving, patient, tolerant, kind"? This is a perfect example of Orwellian double-think. --- news://freenews.netfront.net/ - complaints: news@netfront.net --- |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 29 06:34PM +0100 On 29/09/2014 17:56, Rick C. Hodgin wrote: > Athiest Penn Jillette's video where he discusses Christian > evangelism (3:42): > http://www.youtube.com/watch?v=u4a4AU9FYyc The difference is you are TROLLING a technical newsgroup with religious posts. /Flibble |
Louis Krupp <lkrupp@nospam.pssw.com.invalid>: Sep 28 09:28PM -0600 On Mon, 29 Sep 2014 00:25:47 +0200, Johann Klammer >The code fragment is from a gperf generated file.... >Note: g++ is used for compilation. >what to do? A search for __gnu_inline__ turned up this: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41194 I don't understand it, but you might find it useful. Louis |
Johann Klammer <klammerj@NOSPAM.a1.net>: Sep 29 01:00PM +0200 On 09/29/2014 05:28 AM, Louis Krupp wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41194 > I don't understand it, but you might find it useful. > Louis Thanks, I'll file a bug with iverilog, then. |
Geoff <geoff@invalid.invalid>: Oct 05 01:06PM -0700 On Sun, 5 Oct 2014 09:14:58 -0700 (PDT), "Rick C. Hodgin" >I testify to what I have experienced. There comes a time when the release of endorphins in the brain causes a mystical experience and a feeling of having touched God. This is a very often sought-after experience, especially in humans who have found chemicals that substitute for or enhance this release. Mankind has been doing this for millennia. Substitution of God for chemicals often facilitates recovery from drug or alcohol addiction where the subject can acquiesce to his weakness and hand over his recovery to a "higher power", thus laying the blame for his addition on that weakness and creating an endorphin cycle which supplants the addiction. Good if it works, bad when that person crosses over into psychosis and believes God talks to or through him. History is filled with stories psychotic individuals who thought or claimed God spoke to them. One favorite method in the Old Testament for entering this state is to go out alone into the desert and nearly starve to death or dehydrate enough to enter the fugue state and commune with God, then go back to civilization and command them to repent their evil ways. |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Oct 05 01:12PM -0700 Only those the Father draws to His Son will be able to receive this gospel message. It is given for them and they will know on the inside that it is for them. It is not given for those who will not hear the message. Not hearing is an exceedingly fearful place to be. My prayer is that each of you will hear, and come out, and be saved. Best regards, Rick C. Hodgin |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment