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 47 1 2 3 4

Search: Search took 0.07 seconds.

  1. Re: Passing a class to a sprintf() and similar

    just a lot of luck :)

    seriously, passing to printf ( or any C function vararg ) anything other than a POD with a matching format specifier will give undefined behavior ( ie, garbage data, a...
  2. Replies
    47
    Views
    1,393

    Re: Is this guaranteed to be correct?

    sadly nothing much to say ... just avoid off-topic non-technical offensive comments, please.
  3. Replies
    47
    Views
    1,393

    Re: Is this guaranteed to be correct?

    ipse dixit, and I suppose it's hopeless pointing out what type safety means ... :cry:



    any_cast won't "fail" in the UB sense, any_cast will return 0 if a wrong pointer is passed and will throw...
  4. Replies
    47
    Views
    1,393

    Re: Is this guaranteed to be correct?

    I know it's pointless to argument with you but just FYI ( and for other readers )

    nobody's advocating a "liberal" use of boost.any ( or the likes ), but you proabbly misread boost.any...
  5. Replies
    14
    Views
    325

    Re: How to solve this factorial

    fac it competition !!!
    possibly overflowing, fully portable, just one goto and no 'if' or '?:' :D :



    int fac( int it )
    {
    int fac(it);
    struct fac { virtual void it(){} } again,...
  6. Thread: OCR project

    by superbonzo
    Replies
    10
    Views
    281

    Re: OCR project

    I don't have a Skype account, sorry. You can ask questions here or you can send me a PM.
  7. Thread: OCR project

    by superbonzo
    Replies
    10
    Views
    281

    Re: OCR project

    I had exactly the same problem some years ago; well, it was not a stock market quote service, but some other live feed of data; there was no API, just an ugly legacy Internet Explorer-only Java web...
  8. Re: Exit two-threaded program with user input?

    this is by design, letting a joinable thread object to destroy will invoke terminate ( and for good reasons ), don't do that.



    You should either join and wait for it to finish or detach and use...
  9. Replies
    9
    Views
    341

    Re: Casting Pointers in C style?

    I do not agree (*), at least, as far as the "recommendation" is concerned. Note that a functional style cast can be easily confused with a constructor call whereas it's just a C cast in disguise,...
  10. Replies
    11
    Views
    359

    Re: Templated upcast function

    I think something like this might be simpler



    namespace details{
    template <typename TBase, typename T>
    TBase& DoUpCast(T& t,std::true_type)
    {
    return dynamic_cast<TBase&>(t);
    }
  11. Replies
    2
    Views
    186

    Re: regx to parse key=value pairs.

    I don't think regex supports "variadic" capture groups ( at least, it would be new to me ). What I'd do is use regex_search or regex_(token_)iterator instead:



    #include <iostream>
    #include...
  12. Replies
    45
    Views
    1,836

    Re: Difficult Algorithm!

    sorry, I'm not sure I understood what you said; are you referring to what I described as "the (strictly increasing) function giving the village positions" ?

    if yes, consider, say, villages placed...
  13. Replies
    45
    Views
    1,836

    Re: Difficult Algorithm!

    thinking about it, the "continuous" limit has a rather trivial solution; that is, a straightforward calculation shows that if the (strictly increasing) function giving the village positions is...
  14. Replies
    45
    Views
    1,836

    Re: Difficult Algorithm!

    ok, so we agree; now, it's up to Sarkoy to realize that his "divide and balance" strategy will not give an optimal solution ... :)
  15. Replies
    45
    Views
    1,836

    Re: Difficult Algorithm!

    I think the confusion comes from the fact that you didn't rigorously specified the to be minimized quantity. Sarkoy is referring to the maximal distance between groups separated by hospitals, whereas...
  16. Replies
    27
    Views
    1,283

    Re: passing smart pointer

    and if you search "java pass by reference" you'll find neverending discussions even more hilarious than ours. Indeed, due to the fact in Java "assignment" ( and parameter initialization ) of...
  17. Replies
    47
    Views
    1,393

    Re: Is this guaranteed to be correct?

    ... and I have some doubts concerning the portability of the comparison of the so obtained void* in this case ... and even if the code were perfectly legal and guaranteed, I'd be not surprised to...
  18. Replies
    47
    Views
    1,393

    Re: Is this guaranteed to be correct?

    well, the "make sure all return values are unique", the "add more here" and the "you'll still need to define all the specialisations" parts look like a no-go as far as the OP is concerned. As far as...
  19. Re: A question regarding throwing an exception

    let's rephrase it,

    when an exception is thrown, living automatic (ie stack) objects are destroyed in reverse order ( in a process called "stack unwinding" ); if an exception is thrown from a...
  20. Replies
    47
    Views
    1,393

    Re: Is this guaranteed to be correct?

    uhm, I'd say no, it will return true instead. The type map machinery in my previous post will exactly compensate for the types reordering ( the composition f1 o f2^-1 as in the example above ).
    ...
  21. Replies
    47
    Views
    1,393

    Re: Is this guaranteed to be correct?

    a conforming compiler should guarantee that ( as long as some requirements are fullfilled, see post#3 )


    as suggested in post #9, you can avoid the NextUniqueId() function calls, at the cost of...
  22. Replies
    47
    Views
    1,393

    Re: Is this guaranteed to be correct?

    yes, the only goal of hash_code is to provide a good hash function for unordered containers, that is to provide uniformity and low ( but not zero ) collision probability.

    conversely, type_index (...
  23. Replies
    47
    Views
    1,393

    Re: Is this guaranteed to be correct?

    the said requirements essentially being having the same tokens and resulting in the same name lookup ( that is true for your use case; pathologies may arise when T-dependent lookups kick in, like,...
  24. Replies
    21
    Views
    1,175

    Re: vb.net ... why bother?

    wait, I got it it's a joke, like the Chuck-Norris-Facts meme ... now, my turn, ehm ...

    Java makes you feel better
    Java makes you more attractive to the best girls
    Usain Bolt used Java to...
  25. Replies
    2
    Views
    309

    Re: Multi threaded insertion into STL Map

    without synchronization, you'll have race conditions ( = really bad :) ). That said, yes, iterators are not invalidated by insertions, but again, without synchronization anything can happen.
Results 1 to 25 of 1151
Page 1 of 47 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