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

Search:

Type: Posts; User: superbonzo

Page 1 of 49 1 2 3 4

Search: Search took 0.06 seconds.

  1. Replies
    1
    Views
    124

    Re: Finding valley in 2D height map

    as far as I can tell, it's a variation of the flood fill algorithm ( you can google it; there's also an equivalent problem in graph theory whose name I cannot recall now ) with some special easily...
  2. Replies
    5
    Views
    268

    Re: Solution of a recurrence relation

    to convince yourself that it's indeed O(n^2), it's easier to just write down the number of times "c" is incremented for a given n ...

    moreover, note that,in general, given

    Function(n)...
  3. Thread: .h and .cpp

    by superbonzo
    Replies
    43
    Views
    1,571

    Re: .h and .cpp

    if by "functionally equivalent" you mean that the build process will behave the same ( in terms of compilation speed, size, correctness, generality ) then no, for the previously mentioned reasons.
    ...
  4. Replies
    18
    Views
    631

    Re: [RESOLVED] map iterators

    it's still wrong, the line



    if (piter == OPTITER()) {


    will evaluate to true if piter is set to OPTITER()
    but, it will evaluate to false IF it was set to any other map instance iterator...
  5. Replies
    18
    Views
    631

    Re: [RESOLVED] map iterators

    you're totally right :blush:, actually my reasoning in my last post just implies that IF the comparison is well defined ( the standards says, "it's in the == domain" ) THEN it must follows that the...
  6. Thread: .h and .cpp

    by superbonzo
    Replies
    43
    Views
    1,571

    Re: .h and .cpp

    then I'm not sure we're following each other :) I'l try to rephrase if I explained myself badly



    they are not equivalent for two reasons

    1) unless you template or you ( or the compiler )...
  7. Thread: .h and .cpp

    by superbonzo
    Replies
    43
    Views
    1,571

    Re: .h and .cpp

    it’s not an “advantage”, it’s your only option if you want your header to be used in more than one TU, and ( supposing you want your code to be reused by you or others, in any scenario ) you should...
  8. Thread: .h and .cpp

    by superbonzo
    Replies
    43
    Views
    1,571

    Re: .h and .cpp

    no, the stl does not contain ODR entities in its headers ( just to be clear, by ODR entity I essentially mean anything that would give a linker error if compiled in multiple TUs ). As you know,...
  9. Thread: .h and .cpp

    by superbonzo
    Replies
    43
    Views
    1,571

    Re: .h and .cpp

    one thing is to be open-minded, another is hijacking the ( very flexible ) c++ compilation model.

    yes, cpp files are neither part nor intrinsic to the c++ language, but translation units are. And...
  10. Re: a searching algorithm in a circle: 1 unidirectional, 2- Bididirectional

    BTW, for big N,M, that's the avarage of the shortest path ( that is the euclidean distance ), that is, for a square region NxN :

    (1/N^2) * integral_from{-N/2}to{N/2} integral_from{-N/2}to{N/2}...
  11. Re: a searching algorithm in a circle: 1 unidirectional, 2- Bididirectional

    do you mean that when A is "commanded" to send a message to B, A knows both A's and B's address (01,02,...) and the topolgy and ordering of numbers in the grid ? moreover, by "routing" do you mean...
  12. Replies
    18
    Views
    631

    Re: [RESOLVED] map iterators

    uhm, yes and no ( well, to be really picky, I know :) ); default initialization gives you singular iterators, that may or may not compare equal ( consider "int *a,*b; assert(a==b); // we don't know"...
  13. Replies
    18
    Views
    631

    Re: [RESOLVED] map iterators

    Reachability does not excluded that. For example, consider a graph with a tree topology; it could expose forward iterators from leaf to (the common) root, or even bidirectional iterators ( with some...
  14. Replies
    18
    Views
    631

    Re: [RESOLVED] map iterators

    are you sure ? map does not invalidate iterators (unless previously erased), so end() is required to not get invalidated, AFAIK.
    That said, I agree that boost:: optional would be the way to go ......
  15. Replies
    21
    Views
    832

    Re: Opinions on my get/set approach

    exactly, and the question is, are locking properties the right way of encapsulating synchronization ? ( note that you mentioned locking as a *reason* for using getters/setters ) I don't think so....
  16. Replies
    21
    Views
    832

    Re: Opinions on my get/set approach

    ... including compiler generated ones ( eg. may need a deleted move constructor/assignment operator ); moreover, in general, construction sideffects may still need synchronization ... maybe ruzzle's...
  17. Replies
    4
    Views
    308

    Re: Why should this code snippet crash?

    you're incrementing the positions member that in turn is delete'd later, causing UB and hence the crash. This would not have happened if the NavPath class and the ConvertNavPathToVector3 function...
  18. Replies
    4
    Views
    308

    Re: Why should this code snippet crash?

    not there, your bug is somewhere else.
    BTW,



    avoid this kind of defensive style, it's useless at best ( you can safely delete a null pointer ), and it may hide existing bugs ... ( what if the...
  19. Re: Sequentially remove one element from a vector at a time with replacement

    if you don't need memory contiguity then you can use a non-owning view instead ( take alook at boost filter iterator, for example; this has the bonus of generalizing to any filtering predicate );...
  20. Re: Reduction of the flash footprint

    not necessarily, in this specific case it's probably quite easy;

    just for fun, if we compile the snippet



    // compile with: clang -S -emit-llvm test.cpp

    #include<iostream>
    struct A{~A(){...
  21. Replies
    5
    Views
    405

    Re: question about matrix maniplation

    eigen is also header only, so you can use it as is ( just download the latest version from eigen site and set the include path accordingly ). It's also based on expression templates but capable of...
  22. Re: Reduction of the flash footprint

    another way is to use the clang compiler instead of gcc; then, use the llvm api to write an ad hoc optimization module ( working either on the c++ AST or on the IR code ) to strip destructors ( even...
  23. Replies
    7
    Views
    589

    Re: What direction to go

    if you decide to follow the self-taught route, then probably the only true way of testing your knowledge is to write non trivial programs.

    sure, your first complex programs will be crap: useless,...
  24. Re: Erorr asigning pointer to iterator ( only after porting to VS2013 )

    that code is and has always been wrong, because std::vector iterators are guaranteed to be random access iterators and nothing more ( as you noticed, this includes the possiblity for an STL...
  25. Re: how get the keyboard messages, when the window loses the focus?

    @Cambalinho, FYI, an easier ( well, general key to char mapping apart ... ) and safer alternative to hooking is the raw input api, see MSDN for further details.
Results 1 to 25 of 1207
Page 1 of 49 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center