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


Type: Posts; User: superbonzo

Page 1 of 52 1 2 3 4

Search: Search took 0.05 seconds.

  1. Re: How to make a std::map return null when there is nothing "at" a certain position?

    why ? functions and "pure" lambdas are *almost* equivalent ( ignoring ADL issues ), what would buy you a local function wrt a "pure" local lambda ? locality aside, note that the point here is also...
  2. Re: CRLF problem in code blocks ?

    OK, found the problem, the culprit was the (online) c++ editor from which I copy pasted the output, that silently appended a lot of spaces after each line ( but the first ), hence creating the doubly...
  3. Re: CRLF problem in code blocks ?

    uhm, leave aside the code snippet, please; consider the following, hand typed code block

    / \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__
    \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ ...
  4. Re: CRLF problem in code blocks ?

    uhm, If it were the logic in the code snippet, then how the same (I mean literally, the one I copy pasted between code tags ) output renders correctly on a platform and not on another ? :confused:
  5. [RESOLVED] CRLF problem in code blocks ?

    please, take a look at this post;

    there's an ascii graphics in a code block at the end; it renders correctly on Windows, but on mac shows doubled lines; maybe, a crlf issue ?
  6. Re: How to make a std::map return null when there is nothing "at" a certain position?

    and if you need this only in one place, so that creating a new class just for that it's not worth it, but using find() makes your code difficult to follow, it's easy to write a local lambda nowadays:...
  7. Replies

    Re: Hexagon Grid

    as previsouly said, you just need a pair of integers for representing a position in the hex grid; "moving" between cells simply means adding integers vectors.

    For example, given the generators in...
  8. Re: error: prototype for 'int miniBag::add(const T&)' does not match any in class

    uhm, the error says it all ... functions declared in the class body should have the same signature of the corresponding out of class body definition ( take a look at the add(),has(),etc... members...
  9. Re: How to make a std::map return null when there is nothing "at" a certain position?

    but this is not what the OP asked for; he's not trying to handle errors, he wants a "find" with a zero fallback value;

    is the -1 return value an error code or a valid result ? in the latter...
  10. Replies

    Re: Hexagon Grid

    nope ( depending on what do you mean by homogeneous ), there are also the so called quasicrystals ( like Penrose tilings ), that are nothing but aperiodic projections of higher dimensional regular...
  11. Re: What is the best matching data structure for C# binary heaps in C++ with boost?

    well, then use a std:: set as razzle suggested, or, if you really need an heap for performance reasons and erasures are rare, you can use a std:: vector with the heap functions I previeously referred...
  12. Re: What is the best matching data structure for C# binary heaps in C++ with boost?

    FYI, the c++ standard library also sports a set of heap functions ( make_heap, etc ... ) that allows you managing any mutable random access sequence as a heap, with no space overhead ( and no time...
  13. Re: Code runs 2x faster on windows than on linux

    ok, no compiler magic involved; googling around, it appears that integer division is a special beast with data dependent latency ( as far as I got it, the cpu optimizes division for smaller sizes )...
  14. Re: Code runs 2x faster on windows than on linux

    @2kaud, can you post the generated asm ? maybe, a smaller size allows the compiler to unroll the loop and perform two loop cycles in a single op ...
  15. Replies

    Re: Fitting linear models on time series

    the most important thing is, what do you want to achieve ? are you interested in forecasting ? decimation ? clustering ? etc ...
  16. Replies

    Re: Sorted vector/list to set

    AFAIR, associative containers have always been guaranteed to be linear-time on sorted, hinted insertions ( and hence possibly faster than their general, logarithmic behavior ). So, I think your 2009'...
  17. Re: Problem while porting from 2008 to 2013

    the issue is rather that std::istream declares an explicit operator bool() ( from c++11 on ) that in turn exactly forbids such conversions via copy-initialization ( as explicit constructors do ). Why...
  18. Replies

    Re: Counting the number of re-rankings

    literally speaking, no, it's not possible because there are infinifetly many ways of represening a permutation ( = an ordering ) as a finite product of transpositions ( = a move ).

    That said, if...
  19. Replies

    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...
  20. 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...
  21. 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...
  22. 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...
  23. 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 )
  24. 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,...
  25. 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...
Results 1 to 25 of 1282
Page 1 of 52 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