Search:

Type: Posts; User: CodeMonkey

Page 1 of 20 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    1
    Views
    866

    I don't have references to the standard for you,...

    I don't have references to the standard for you, but here is my reasoning.

    The extern variable declaration for "sameName" within "increment()" does not shadow the static "sameName". So, when the...
  2. After a while, it becomes fruitless to debate...

    After a while, it becomes fruitless to debate which language features to use, and which ones not to use. The first time, maybe. Or when there's a new hire. Or when you transfer to another team. ...
  3. I have a solution, but I don't know how much I...

    I have a solution, but I don't know how much I like it. It's working, anyway.

    The trick is to define a function, "bless," that given a Validated<Foo> and a pointer-to-Bar-member-of-Foo, will...
  4. Replies
    6
    Views
    4,935

    It can be. As your example shows, when you mix...

    It can be. As your example shows, when you mix integer types in arithmetic expressions, the language applies conversion rules, some of which are hard to remember.


    I don't know, but I'm willing...
  5. Patterns that avoid two-phase initialization and exceptions

    I'm prototyping a new library for distributed tracing. It will solve the same problems that GitHub - DataDog/dd-opentracing-cpp: Datadog Opentracing C++ Client solves.

    It'll require C++17, and...
  6. mmap() is standardized by POSIX: mmap...

    mmap() is standardized by POSIX: mmap

    So, it's not included in the C standard library, but it is available on Linux, MacOS, AIX, etc.

    mmap() tells the system to map a file to the process's...
  7. Replies
    2
    Views
    1,833

    Neat, nice find. > Why not? Sure, why not,...

    Neat, nice find.

    > Why not?

    Sure, why not, but I would assume that the hashing interface was added for use elsewhere in the standard library. Where, though? In C++98, there was no regex,...
  8. When you say that the program stops, what do you...

    When you say that the program stops, what do you mean exactly?

    I'm imagining that your program is receiving a signal from the operating system. That's likely to happen anywhere you sleep, since...
  9. Replies
    2
    Views
    1,833

    std::collate::hash historical question

    I'm working with some C++14 code. A library we're using has its own partial port of C++17's std::string_view, but without a corresponding specialization of std::hash.

    I assumed that the standard...
  10. Replies
    7
    Views
    7,817

    If you're comfortable with the relationship...

    If you're comfortable with the relationship between pointers and const, and which pointer conversions are allowed, then you can apply that understanding to const member functions.

    Imagine that...
  11. This is a bit much, but the following might help...

    This is a bit much, but the following might help you to better understand whatever it is you're working with.



    #include <cstdint>
    #include <vector>

    void arrays() {
    // this is an...
  12. Replies
    4
    Views
    7,777

    I thought I had made another reply, but I think I...

    I thought I had made another reply, but I think I accidentally deleted it.

    I don't know what an array-based unordered list is, but after googling around and reading some Java documentation, my...
  13. Replies
    4
    Views
    7,777

    C++ has classes, which are user-defined types,...

    C++ has classes, which are user-defined types, and C++ has functions. There are also member functions, which are like normal functions except:
    - They have an additional hidden parameter: "this."
    -...
  14. Replies
    7
    Views
    6,776

    XAML is valid XML, so you can use XPath...

    XAML is valid XML, so you can use XPath to extract the information you want. I've never used an XML parsing library with XPath in C++ before, but here's what Google has to say:

    - GitHub -...
  15. Replies
    0
    Views
    3,784

    Generating C++ Code

    Hey good looking people,

    My question is about the general problem of writing a tool (a source-to-source compiler) whose output is C++ and whose input is not. Think protocol buffers.

    In my...
  16. I learned at first by googling for online...

    I learned at first by googling for online tutorials and asking questions on this board.

    However, that's the inefficient way. I didn't even begin to understand the language until I read...
  17. Replies
    2
    Views
    1,979

    int displayFastestSkier(string name[], double...

    int displayFastestSkier(string name[], double time[])
    // How is 'name' used in this function?
    {
    int x = 0;
    int fastestTime = 1000; // Why 1000?
    for (x=0; x<5; x++) // Why 5?
    ...
  18. Replies
    7
    Views
    1,069

    What exactly is the goal here? Your question...

    What exactly is the goal here? Your question seemed to be about separating a singly linked list into three singly linked lists based on some property of each node. You said

    I see that a person is ...
  19. In pseudo-code, then: nRows = input() for...

    In pseudo-code, then:


    nRows = input()
    for currentRowNumber in nRows...1
    print currentRowNumber of '@', then '\n'

    or, if you don't want to go backwards:
  20. Replies
    7
    Views
    1,069

    Announcements - General Programming Boards...

    Announcements - General Programming Boards

    Let's see your code, and what problems it's giving you.
  21. No, phantomotap, I don't think what I'm trying to...

    No, phantomotap, I don't think what I'm trying to accomplish can be achieved without the wrapping classes. In addition to having shared ownership of the resource, a last_ptr also guarantees that it...
  22. I thought that might be a problem. Where is the...

    I thought that might be a problem. Where is the race, though? My understanding is that when waitUntilDeleted() checks isDeleted.load(), a competing thread in markDeleted() must be on one side or the...
  23. Replies
    4
    Views
    4,175

    Python allows you to make that distinction too....

    Python allows you to make that distinction too. While there's no char type like there is in C, python has the functions chr() and ord():


    # Python
    s = 'a'
    first = s[0]
    assert firstChar == s #...
  24. Replies
    9
    Views
    1,314

    #include #include int...

    #include<stdio.h>
    #include<math.h>

    int main()
    {
    const double zeta5 = 24.88626612344087823196;
    double a, b, c, d;
    const double e = 2.718281828459045235360287;
    double f,...
  25. Replies
    5
    Views
    5,259

    I'm not familiar with lex/yacc. I'm wondering...

    I'm not familiar with lex/yacc. I'm wondering about what your grammar would look like in normal form.

    Is this what you are describing?



    <tree> ::= <node>
    <node> ::= <number>
    | "<"...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4