IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 2 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Not quite
there's a method on string to get a pointer to the internal character array. You have to call that.

string filename = "myfile.dat"

ifstream fin(filename); // doesn't work

has to be

ifstream fin(filename.c_str());

Mighty lame.



Democracies are not well-run nor long-preserved with secrecy and lies.

     --Walter Cronkite
New Ugly, but not a critical flaw
To deny the indirect purchaser, who in this case is the ultimate purchaser, the right to seek relief from unlawful conduct, would essentially remove the word consumer from the Consumer Protection Act
- [link|http://www.techworld.com/opsys/news/index.cfm?NewsID=1246&Page=1&pagePos=20|Nebraska Supreme Court]
New Pretty much sums up C++
New It's totally against the original spirit
It's like C++ consuming itself. A natural idiomatic expression turns out to be impossible.

IIRC you can get around even this stupid requirement with nastycasting.
-drl
New No, just pointlessly inconsistent
Which makes for pointless wastes of time having to look up all the shit that doesn't work the way you'd think it ought to all the time.



Democracies are not well-run nor long-preserved with secrecy and lies.

     --Walter Cronkite
New Re: No, just pointlessly inconsistent
Definition of a good idiom: One that doesn't imply its own self-inflicted defeat.
-drl
New Per Barney:
Conversion to a C-style string could have been provided by an operator const char *() rather than c_str(). This would have provided the convenience of an implicit conversion at the cost of surprises in cases in which such a conversion was unexpected.
--The C++ Programming Language -- Special Edition Bjarne Stroustrup.

So there you have it! The Framers were trying to protect you from youself. Just like Java! Rejoice and be glad in their thoughtfulness!

;-\ufffd

(For what it's worth, I don't like it either!)

So here's a suggestion: With all the wry (or rye) sarcasm you can muster, helpfully point out to the class the thoughtful parochialism of the Framers, and then suggest the creation of a derived sString class, (for smart String) that defines an overload of operator const char *(), and strongly suggest (read: demand) that this derived class be used in all your assignments. It would extend your class's understanding, and would give some useful metrics on how often (or whether) such parochialism was a hindrance as opposed to a help. (I suspect I know what these metrics will show, but real-world numbers trump my suspicions any day of the week and twice on Sunday!)
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT

New It's stupid
Idiomatic expressions should work without handsprings. They used to, in the "better C" days.
-drl
New No, I agree with the decision
to avoid the op const char*. Although I think leaving it out is a violation of the design philosophy of C++, which as far as I can tell is to follow "The Principle of Most Surprise".

OTOH, I think its totally stupid to have a whole chunk of streams library implemented in terms of string ([io]stringstream) and then not have a ctor for [io]fstream that allows you to use the string.




That was lovely cheese.

     --Wallace, The Wrong Trousers
New Agreed...but...but...
Yes, the [io]fstream most assuredly should support a string constructor (and a wstring constructor, as well). But don't you know that the [io]fstream stuff was supposed to be a "better stdio that stdio?", and so thererfore would have to support analogs to stdio's [f]open? Maybe they just took the analogs a bit too literally.

Besides, I think what really happened is that in pre-ANSI stream libraries, there was no string class (at least, not a standardized one that anyone could count on being there); instead, there was a mish-mosh of non-standardized ASCII character containers, many of which were called string. By allowing the one true string class to be used as an option, it could well have broken existing compilers implementations of their proprietary garbage. Both X3J11 (ANSI C) and X3J16 (ANSI C++) committees went through hoops to try to minimize breakage of existing code (IMHO, to the detriment of both languages), and it was probably thought that the risk of breakage was too great.

I would expect that C++ V2.0 would fix this rather egregious omission, and to hell with anybody's code that it breaks!
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT

     C++ - the stupidity continues - (tuberculosis) - (15)
         AHHHHH.... Good to see you posting... - (folkert)
         Good to see you again! - (Another Scott)
         TB hola brother! - (deSitter)
         They what? - (ben_tilly) - (10)
             Not quite - (tuberculosis) - (9)
                 Ugly, but not a critical flaw -NT - (ben_tilly) - (4)
                     Pretty much sums up C++ -NT - (JayMehaffey)
                     It's totally against the original spirit - (deSitter)
                     No, just pointlessly inconsistent - (tuberculosis) - (1)
                         Re: No, just pointlessly inconsistent - (deSitter)
                 Per Barney: - (jb4) - (3)
                     It's stupid - (deSitter)
                     No, I agree with the decision - (tuberculosis) - (1)
                         Agreed...but...but... - (jb4)
         Hooray! Todd's back! :) -NT - (FuManChu)

We are gonna party all... night... LONG!
83 ms