I believe tabstop was suspecting that your string result_file had a newline appended to it, and the OS couldn't find that file.
I think your suspicions are probably right though. The...
Type: Posts; User: whoie
I believe tabstop was suspecting that your string result_file had a newline appended to it, and the OS couldn't find that file.
I think your suspicions are probably right though. The...
I would argue that the "one case instance", that is, default initialization to zero, is the most common.
What operator would you use to describe a ranged set of elements though? There is nothing...
Then you can derive your own streambuffer from std::streambuf and isolate the specific operations. There's no obvious need to stitch that stuff directly into the program. I believe you can still use...
You agreed that initializer_list and DI would not conflict with each other for array indicies, but you claimed that they would conflict with those having field names. I am arguing that...
Perhaps you could use putback(). Extract the newline from the streem to peek the following character, and then put the newline back with putback.
Not sure how scalable that is. Think of a blank...
Nor should there be. That's why there are two cases. One for types with declared constructors (no DI) and one for types without them (DI). No conflict with arrays (as you said before), and no...
But you are forgetting that there are two cases, one for types with declared constructors, and one without (arrays and POD-structs). Also, the initializer_list proposed appears to only handle...
Indeed not. My g++ chokes on them, but gcc does not if it isn't in C90 mode. If anyone is still reading this thread, try plugging this through a C99 compiler and a C++ compiler to see if it goes...
Not if I'm reading this correctly:
Case handled, AFAICT. Also, initializer_list is just going to be resolved to a built-in array, at least in concept. There is no conflict with DI here:
...
All this time, I thought initializing arrays and structures WERE something C++. I simply don't understand your perspective. Why isn't it C++? From what I see, you seem to be saying that:
// C++...
I'll take your word for it. Again, it's the step before, and I would have read it if it applied directly to this particular point. I'll get around to it eventually.
I guess that's a promotion...
Hateful? Moreso than the array initializer's that C++ has right now? I doubt it. Perhaps DI isn't going to be accepted by the snobs, but I could care less. It's useful and it's a win-win IMO.
I...
Ouch. I'm sorry to hear that. I would have liked to read it.
Well, I can only conclude that if it is too hard to type in again, then the macro can't be simpler than the example I posted...
Until you can't because it is const or placed in read-only memory, or you'd rather initialize than assign for debugging purposes, style, coding standard, whatever, and then we are right back here....
Why does that depend? Whether you use old-fashioned initialization or DI, anything not specified is default initialized. I don't understand the dependence that you are pointing out here.
In...
In a way, I suppose you could. iostreams is supposed to be abstractions that "control input from and output to character sequences". So, you still have to honor its "contract" in some way. How would...
Fair enough. I wasn't too clear about that.
What I meant to say, was that they aren't going to incur any more runtime overhead than the old-fashioned initialization.
struct foo {
int a, b,...
Assignment is not initialization!
The array example I showed above is more verbose than that initialization without DI? Hardly. It is far less than writing out an entire table of zeros with three...
Really? That's awesome! How do you do that for this array stored in read-only memory then?
const unsigned char __eprom lookup_table[] = {
[0x5E] = 0xAE, [0x3A] = 0x4D, [0x17] = 0xB9
};
...
Designated initializers. It's one of those things that a computer can do much better than a living person. I just have to tell it which element(s) I want initialized to what, and the layout is taken...
I'd just be happy if everyone agreed that designated initializers were as great as I think they are. I can't believe some of the popular compilers that don't support them yet. :confused:
Try overriding the inherited virtual function overflow in the protected section of your class so that it appends the character to your Message member.
Something like (not tested):
class...
You're right, it does sound difficult, but when you get past the initial fuzziness, it's not that difficult at all. It just seems a lot harder than it really is when you do it for the first time....
Agreed. Often, it is easier to beg forgiveness than to ask permission. Especially, as in this case, when you are actually doing the right thing by going against the rule.
Okay, sounds like a job for iostreams, not operator overloading. That's fairly easy to do, starting with deriving a class from std::streambuf, overriding the virtual functions overflow and sync at...