Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: laserlight

Page 1 of 80 1 2 3 4

Search: Search took 0.13 seconds.

  1. Re: Recursive function: take a non-negative integer and print each digit of that inte

    Hmm... I am not sure if I can articulate it precisely at the moment, so allow me to present examples.

    Looking at the assignment requirements with TheGreatCthulhu's proposed amendment, it looks...
  2. Re: Recursive function: take a non-negative integer and print each digit of that inte

    I think that the fact that it is not tail recursive does imply that an explicit stack is required, at least if you want an equivalent iterative solution rather than a different solution altogether.
  3. Re: Recursive function: take a non-negative integer and print each digit of that inte

    Um, my statement was pertaining to the problem that Smitten posted about, with reference to TheGreatCthulhu's guess. I even mentioned that directly as a preface. I certainly did not state that an...
  4. Re: Recursive function: take a non-negative integer and print each digit of that inte

    If TheGreatCthulhu's guess in post #3 is correct, then the expected recursive solution for the problem that Smitten was tasked with is not tail recursive, and the equivalent iterative solution...
  5. Replies
    63
    Views
    2,924

    Re: Abstraction concept problem?

    Agreed, though the alternative would be the more general term "reference", which of course has the potential for confusion because it does not mean the same thing as a C++ reference. This is...
  6. Re: C++ Class member function Bug Can't see it

    Sorry, but your code fails to be const-correct, so your claim is not true. For example, a function could call GetMineralName then reasonably change the string content because GetMineralName returns a...
  7. Replies
    63
    Views
    2,924

    Re: Abstraction concept problem?

    I tend to agree with the notion of reference semantics as meaning both pointers and C++ references. After all, they both refer to something else, and that is an essential part of their meaning. Take...
  8. Re: Is Template Method design pattern and Hook the same thing by different names?

    It sounds like the terms are synonymous due to having been named in the literature at roughly the same time. (The GoF book was published in 1995.)
  9. Replies
    63
    Views
    2,924

    Re: Abstraction concept problem?

    You retain a copy, so of course there is a price to be paid for making and storing a copy.
  10. Replies
    17
    Views
    900

    Re: New C++ versions

    I have been known to use <iosteam> :p
  11. Re: How to avoid the copying from std::set?

    Notice that they are not const member functions.
  12. Re: How to avoid the copying from std::set?

    The issue is that you cannot arbitrarily change the value of an element of a std::set because it could mess up the ordering upon which the internal construction of the std::set is based. Therefore, a...
  13. Replies
    63
    Views
    2,924

    Re: Abstraction concept problem?

    Well yeah, but consider: it seems from implied context that you already have a CMesh object named m_WarehouseMesh. Therefore, you do not need to make a shared_ptr to point to a copy of it, so...
  14. Replies
    63
    Views
    2,924

    Re: Abstraction concept problem?

    Why are you using make_shared in this case?
  15. Replies
    63
    Views
    2,924

    Re: Abstraction concept problem?

    There is no such thing as a null reference in C++, so this cannot be done. However, there are a few options, e.g.,

    Pass a (smart) pointer instead.
    Define a "null state" for the object, then...
  16. Replies
    12
    Views
    376

    Re: A question regarding protected member

    Because the rule is that "an implicitly-declared copy/move assignment operator is an inline public member of its class" (C++11 Clause 12.8 Paragraph 22b). That the base class' copy assignment...
  17. Replies
    12
    Views
    376

    Re: A question regarding protected member

    There is a rule that says that if you do not declare the copy assignment operator for a class, a copy assignment operator will be implicitly defined. This implicitly defined copy assignment operator...
  18. Replies
    12
    Views
    376

    Re: A question regarding protected member

    Because foo has protected access, whereas the compiler supplied copy assignment operator for D has public access.
  19. Replies
    12
    Views
    376

    Re: A question regarding protected member

    Class D has its own copy assignment operator provided by the compiler.
  20. Replies
    8
    Views
    472

    Re: Getline error

    In other words, as the compiler warnings posted by jlb1 point out, you are actually passing a null pointer constant to a constructor of the string object. Since that particular constructor expects a...
  21. Replies
    7
    Views
    330

    Re: std::vector with negative subscript?

    You cannot access an array with a negative subscript because that would be accessing the array out of bounds. What you can do is to have a pointer point to somewhere in the middle of the array, upon...
  22. Re: How to make boost catch some exceptions when a shared_ptr is null?

    Why not just check if they are null smart pointers?
  23. Re: error C2678: binary '

    If you overload operator< as a non-member, then it should look like this:

    bool operator < (const AABB& lhs, const AABB& rhs)
    {
    // ...
    }
    This function should be within the same namespace as...
  24. Replies
    10
    Views
    651

    Re: Implementig a hot-reload system

    Note that this has also been posted elsewhere.
  25. Re: Using boost::shared_ptr in a std::set comparator?

    Where's the std::set?
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a Codeguru.com survey!


HTML5 Development Center