Search:

Type: Posts; User: whoie

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. I believe tabstop was suspecting that your string...

    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...
  2. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    I would argue that the "one case instance", that...

    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...
  3. Then you can derive your own streambuffer from...

    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...
  4. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    You agreed that initializer_list and DI would not...

    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...
  5. Replies
    4
    Views
    1,756

    Perhaps you could use putback(). Extract the...

    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...
  6. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Nor should there be. That's why there are two...

    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...
  7. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    But you are forgetting that there are two cases,...

    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...
  8. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Indeed not. My g++ chokes on them, but gcc does...

    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...
  9. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Not if I'm reading this correctly: Case...

    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:


    ...
  10. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    All this time, I thought initializing arrays and...

    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++...
  11. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    I'll take your word for it. Again, it's the step...

    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...
  12. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Hateful? Moreso than the array initializer's that...

    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...
  13. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Ouch. I'm sorry to hear that. I would have liked...

    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...
  14. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Until you can't because it is const or placed in...

    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....
  15. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Why does that depend? Whether you use...

    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...
  16. Replies
    19
    Views
    2,154

    In a way, I suppose you could. iostreams is...

    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...
  17. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Fair enough. I wasn't too clear about that. ...

    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,...
  18. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Assignment is not initialization! The array...

    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...
  19. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Really? That's awesome! How do you do that for...

    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
    };

    ...
  20. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    Designated initializers. It's one of those things...

    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...
  21. Thread: C/C++ merger

    by whoie
    Replies
    59
    Views
    5,793

    I'd just be happy if everyone agreed that...

    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:
  22. Replies
    6
    Views
    1,798

    Try overriding the inherited virtual function...

    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...
  23. Replies
    6
    Views
    1,798

    You're right, it does sound difficult, but when...

    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....
  24. Agreed. Often, it is easier to beg forgiveness...

    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.
  25. Replies
    6
    Views
    1,798

    Okay, sounds like a job for iostreams, not...

    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...
Results 1 to 25 of 111
Page 1 of 5 1 2 3 4