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


Type: Posts; User: superbonzo

Page 1 of 51 1 2 3 4

Search: Search took 0.06 seconds.

  1. Re: error: expression must have a class type

    which is a very good thing in this case; if the vector is empty, data() returns a valid pointer and arr.size()-1 == numeric_limits<size_t>::max(), boom !

    you're right about data() being more...
  2. Replies

    Re: Resetting an array

    ... or assignment + (aggregate) uniform initialization:

    myarray = {};

    this literally means "zero re-initialize the array" and should also give the compiler the best optimization opportunity...
  3. Re: InterlockedExchangeRelease doesn't exist?

    uhm no, it's not ( never claimed that reordering does not occur ); my point basically was that speaking of "memory accesses" and "ordering of operations" in vague and undefined terms ( as the cited...
  4. Re: InterlockedExchangeRelease doesn't exist?

    IMHO, it does not, because one is left with the impression that those mysterious memory "accesses" can happen in the wrong order for some mysterious reasons.

    in my view, in order to have a...
  5. Re: Can't find a C++ cast to work for this conversion

    nope, contrary to std::strings, std::vectors have always been contiguous, at least since 2003 ( but of course you're right concerning the need of null termination )
  6. Re: I'm getting a result with cin.putback that I don't understand

    the purpose of putback() is not to push arbitrary data in an istream. You should either use a specialized streambuffer ( see below ) or a stringstream or something else instead ...

    as you know,...
  7. Re: Template parameter resolving to 'nothing' ?

    it's just "standard" CRTP, it has the advantage of automatically "swithcing on and off" only the methods that the CRTP class wants ( with the exception of explicit instantiations );
    if the...
  8. Re: Template parameter resolving to 'nothing' ?

    you said "T2 will only be 'nothing' if T3 also is 'nothing'" and I assumed, the same applies for T4,T5,... so, the specializations seemed to be just two in total ( <T1,T2,...> and...
  9. Re: Template parameter resolving to 'nothing' ?

    nope, it's a specialization so in the "...." you can omit the nothing_t instance, unless for some reason you cannot specialize ...
  10. Re: Template parameter resolving to 'nothing' ?

    ... and why can't you specialize for "nothing" ?

    struct nothing_t{};

    template<class T1,class T2> struct one_two_three<T1,T2,nothing_t> { .... };
  11. Re: Is it possible to switch from release- to debug-mode ...

    ... or supposing the slowdown is due to asserts and the like

    if you don't want to touch your production code and you are using a versioning system that allows fast branching (like git), you can...
  12. Replies

    Re: Emptying CString

    the problem has nothing to do with CString, GetBuffer(), etc.. it has to do with a wrong api call causing a buffer overrun ( see posts #37,38,39 ). GetBuffer() just happened to solve it by chance.
  13. Replies

    Re: Variables declared in Windows loop

    I don't get it, stack overflow issues aside, how can the cost of an heap allocation be smaller ? ...

    if I got it correctly, the cost of addressing <ebp + greater than 128> manifests itself as a...
  14. Re: Can I pass a std::string to a function parameter that is asking for unsigned char

    it depends ...

    if the c-api promises to not mutate the pointed-to chars ( and the pointed to pointer ), then yes you can pass a const_cast'ed c_str() in both cases.

    otherwise, in the first...
  15. Replies

    Re: Seeding a C++11 random

    totally wrong, you're confusing probability theory and inferential statistics ( aka deciding what's better to do or not to do given statistical data, may be called ( or at least strictly related to )...
  16. Re: MFC: PostMessage and Handling it without the hassle (and a question).

    note that neither this nor your previous example are thread safe, if PostLambda is invoked by different threads. BTW, what's wrong with the unique_ptr<> approach ? if your aim is to avoid the free...
  17. Replies

    Re: Emptying CString

    nobody knows for sure, we can just conjecture from the (incomplete) code pieces we're given. The point is that if you don't follow the rules and cause undefined behavior then literally anything can...
  18. Replies

    Re: project on c++ programming

    ... or just check the scalar product of pairs of adjacent sides ( this should be the most numerically stable solution as far as I can tell ) or their cross product ( I suppose this is what 2kaud...
  19. Replies

    Re: Emptying CString

    as it is, this looks like a buffer overrun ( where do you set cSize ? ), when sVersion has not enough space, and explains why adding GetBuffer "fixes" the problem. If this is the case, m_sError could...
  20. Replies

    Re: Seeding a C++11 random

    ... uh, unless you meant to say that it's really wise to *always* consider "regular" ( whatever that's supposed to mean ) events more unlikely, in that case, sure, we don't agree. Invoking Kolmogorov...
  21. Replies

    Re: Seeding a C++11 random

    did you read that post ( not just that line you quoted ) ?

    we're saying more or less the same thing, that is that the street man intuition is more right than it could appear to a blind accademic...
  22. Replies

    Re: Seeding a C++11 random

    this is a bit unfair, probability and randomness are technical terms with many possible techincal meaning and formalizations, the choice of which is entirely conventional

    so, one should not expect...
  23. Re: What is the optimal solution for the game "Puzzle+"?

    what do you mean ? if our reasoning above is correct we have all we need to fully analyse the problem efficiently; basically, the algorithm could goes as follow:

    given an NxM input I, build the...
  24. Re: What is the optimal solution for the game "Puzzle+"?

    ok you're right sorry, I missed some t's ... :blush:

    BUT ( yes, that's a big but :) )

    the fact that more than one solution exists implies that the crosses do NOT actually form a base which in...
  25. Re: What is the optimal solution for the game "Puzzle+"?

    the right one seems not a solution at all ... ( or I totally missed the rules of the game :) )

    as I tryed explaining in post #2, the fact that a solution always exists and the fact that...
Results 1 to 25 of 1264
Page 1 of 51 1 2 3 4

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


HTML5 Development Center