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

Search:

Type: Posts; User: jwbarton

Page 1 of 11 1 2 3 4

Search: Search took 0.35 seconds.

  1. Replies
    18
    Views
    4,743

    Re: Pre and Post Build Steps with VS2015

    I have run into this particular problem at various times.

    There was an old way to diagnose why a project would want to rebuild that was very complicated and hard to configure (I don't even...
  2. Replies
    18
    Views
    3,698

    Re: [RESOLVED] map iterators

    There is another problem with using the default initialization of the iterator which you won't notice until you run the code in DEBUG mode in VS2013.

    The debug version of the iterator comparison...
  3. Re: Destroying an CArray of Cobject derived classes.

    Deriving an class from CObject and then using it in a CArray directly (not as a pointer) requires additional work to be done in the class.
    The CObject class declares a private copy constructor and a...
  4. Re: 'this' pointer corruption or am I fooling myself ?

    I can't get it to happen with the example that you posted.

    One situation that can cause this to happen is if the classes use virtual inheritance.



    class A
    {
    public:
    virtual ~A()
  5. Re: conditional breakpoint with string does not work in visual studio 2010 as I expec

    Unless you are intending to build your program both for Unicode and for single/multi-byte, the use of the various _T macros and _t functions just complicates the program. I don't use them with my...
  6. Re: conditional breakpoint with string does not work in visual studio 2010 as I expec

    The debugger doesn't make it easy to use inline members of classes in conditional expressions.

    However, you can help it by adding extra code.

    For example, you can create a local variable which...
  7. Replies
    10
    Views
    5,928

    Re: boost::shared_ptr with std::vector

    Looking at your first post, I can see a problem with your use of shared_ptr.

    A shared_ptr will delete the object once the last shared_ptr that points to an object goes out of scope. Since you are...
  8. Replies
    4
    Views
    914

    Re: valarray and math.h

    Check if you are including math.h inside of stdafx.h.

    If you are, you need to put the #define inside of stdafx.h, before including math.h. Otherwise any include of math.h after stdafx.h is...
  9. Replies
    15
    Views
    49,133

    Re: How to use #define _CRT_SECURE_NO_DEPRECATE?

    Yes, this is one of the correct ways to handle this.

    When using precompiled headers with the Microsoft compiler, it ignores any code in the source file until it finds the include of the...
  10. Replies
    64
    Views
    29,037

    Re: CArray vs. std::vector

    Using std::string instead of CString with the VS2010 compiler can produce faster results without needing to rely on tricks (treating the CString as a POD).

    The std::string object in VS2010...
  11. Replies
    64
    Views
    29,037

    Re: CArray vs. std::vector

    This has been fixed in Visual Studio 2010 - the default for debug mode is still to have checked iterators, but release mode has _SECURE_SCL set to 0 (at least by default).

    Best regards,
    John
  12. Replies
    22
    Views
    2,893

    Re: Changing function based on a condition?

    I think to get the same meaning as the original, better style would be


    bool valid = false;
    while (! valid)


    (and then set valid = true in when the string entered is valid).

    Best...
  13. Replies
    34
    Views
    9,908

    Re: Detecting memory leaks (VC8)

    This most likely isn't reporting a leak due to the small string optimization that is done with std::string.

    Basically, for strings with 15 characters or less, the data for the string is held...
  14. Replies
    6
    Views
    705

    Re: Multiple virtuality

    You can achieve this by using a double dispatch, which is often achieved using the Visitor pattern.

    One way of implementing this is as follows:



    #include <iostream>

    using namespace std;
  15. Replies
    12
    Views
    1,771

    Re: I need help with STL: vector

    I too wouldn't recommend using this, but anyone using STL should still be aware of how it works.

    There are guarantees provided by the standard for each container which specify exactly how and when...
  16. Replies
    12
    Views
    1,771

    Re: I need help with STL: vector

    An erase() on a vector will only invalidate elements after the erase location - iterators to elements before the erase location remain valid.

    An insert() on a vector will only invalidate elements...
  17. Re: print out command that entered

    This isn't necessarily true. When running on Windows, the command line is parsed by the startup code of the executable. This is parsed into the familiar argc/argv before the runtime calls main().
    ...
  18. Replies
    11
    Views
    1,994

    Re: Remove Vector Element

    The behavior you observed is normal.

    When you use remove_if(), the vector is modified by shifting any elements which don't match the predicate up (any which SomeFunc() returns false). The...
  19. Re: Problems designing my vectorized math library

    While conceptually this is true, in practice it depends on the compiler implementation. It is true that the computed result of using a non-member operator with __m128 is the same as making a class...
  20. Re: Problems designing my vectorized math library

    I am not the original poster. I was just curious what the reasons were for the performance problems reported by the original poster.

    My idea was to try to provide the original poster with the...
  21. Re: Problems designing my vectorized math library

    I stand corrected.

    I had the syntax wrong and the compiler error I got didn't help.

    Is this correct?



    __m128& operator+=(__m128& a, __m128 b)
    {
  22. Re: Problems designing my vectorized math library

    I took a quick look at the code generation for an intrinsic __m128 using direct calls to _mm_add_ps() to add the 4 floats, and then the member routine in your float4 class which also calls...
  23. Replies
    7
    Views
    1,365

    Re: Member function as function argument

    Hi Johnny,

    When I provided the original solution, I was just going for a quick and dirty solution.

    There is a solution which doesn't require writing the BoundModelFunc adaptor (assuming that it...
  24. Replies
    7
    Views
    1,365

    Re: Member function as function argument

    The easiest way is to just make a new member function of the Model:



    // needed include file:
    #include <cmath> // or <math.h>
  25. Replies
    7
    Views
    1,365

    Re: Member function as function argument

    Your problem is that you can't pass a pointer to a member function to a routine that expects a pointer to a normal function.

    You need to provide an adaptor that will make bind the model object...
Results 1 to 25 of 255
Page 1 of 11 1 2 3 4





Click Here to Expand Forum to Full Width

Featured