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.05 seconds.

  1. Re: A compiler error with the implementation of smart pointer

    note that shared_ptr operator* is marked noexcept since c++11, so it cannot sensibly throw even in principle. This is also probably the reason why it is so, that is to allow shared_ptr to be...
  2. Re: The techniques to guard buffers against overflows.

    anyway, I think you should clarify your goal, that is, if we're dealing with buffer overflow from the code correctness pov ( ie, does *my* code have buffer overflow issues ? ) or from the security...
  3. Re: A question regarding double-checked locking

    you missed the point, they're not unrelated at all, they operates on the same variable !! ... this disproves your claim that the sideeffects of a constructor are never reordered on "sane" compilers...
  4. Re: A question regarding double-checked locking

    in c++11, a race condition invokes undefined behavior, that code has a race condition, that code has undefined behavior, period ( FYI, the language defines "undefined behavior" as, ehm, undefined...
  5. Re: A question regarding double-checked locking

    to be picky :), this makes little sense, that code invokes undefined behavior so it doesn't guarantee anything by definition ( say, a thread reading a non initialized singleton ( hence with broken...
  6. Re: A question regarding double-checked locking

    you're simply wrong; in pre-c++11 era the language abstract machine had no notion of "threads" or synchronization, so whether some code is race free or not was totally platform/thread-library...
  7. Replies
    9
    Views
    1,027

    Re: Unlcoking a mutex from crashed thread

    so, I suppose that the thread is probably invoking undefined behavior somewhere ( otherwise, you should be able to easily find out where the error occurs ) ...



    are you sure ? being undefined...
  8. Replies
    6
    Views
    1,301

    Re: How to use Perceptualdiff

    as far as I can tell, I don't think so; the purpose of that tool is to compute a psychophysically based per-pixel metric of computer generated images to ease unit testing. Hence it's a (very useful...
  9. Replies
    8
    Views
    1,327

    Re: Program-unique values

    you're totally right; otherwise, the namespace should be unique to the file in which the template is declared ( which may or may not suit your usecase depending on how/where you declare the global )...
  10. Replies
    6
    Views
    1,301

    Re: How to use Perceptualdiff

    first of all thank you, the tool and the papers in the supplied link are really interesting ...

    anyway, regarding why you received no feedback; firstly, did you tried asking to the tool...
  11. Replies
    8
    Views
    1,327

    Re: Program-unique values

    if it appears in an header as is, yes, but you can always redeclare it in each and every file where's needed ( eventually with the help of a macro; actually note there's a typo in my post: the...
  12. Replies
    8
    Views
    1,327

    Re: Program-unique values

    I'm not sure I got what you mean by "a program-wide unique value to use as a template parameter", do you mean something like this ?



    namespace some_name_space {
    template< unsigned lineid,...
  13. Re: A faster algorithm than dijkstra's algorithm

    ... or define the length as minus the logarithm of the factor ;)
  14. Re: A compiler error with the implementation of smart pointer

    this is not entirely correct, the compiler does compile function template bodies and checks syntax and some non-dependent expressions; it's just that it's not required to diagnose other errors (...
  15. Re: How to use function that returns vector?

    returning containers is not *that* bad nowadays, note that in this case (as in post#6 and #7) the compiler is *required* to move as a worst case ( it also can and probably will perform move-elision...
  16. Re: The drawbacks of passing arguments by const

    ... and by (const) rvalue reference and by universal reference ( aka argument forwarding ) as well :). Anyway, IMO, any "pass by X" reasoning is short sighted because:

    1) it gets soon overly...
  17. Re: How to raise priority of MIDI input callbacks? Thread pools etc.

    I think it's a terminology problem; correct me if I'm wrong, by "preempting" you seem meaning the act of interrupting a thread *during* its timeslice to pass execution *immediately* to some other...
  18. Re: regex alternation, obtain the alternation index ?

    that would be a very useful feature indeed; anyway, if you're allowed modifiying the to be searched string then ( depending on your actual regex ) you could try something like



    #include...
  19. Replies
    27
    Views
    1,944

    Re: Bool type problem

    AFAIR, note that bool and enum bitfields follow special rules making OReubens claim essentially correct ( I cannot quote the std at the moment (I'm typing from a mobile device ) ) and forcing the int...
  20. Re: How do I remove an element of a vector and returning it?

    if "it" is an iterator referring to the to be removed element, "v" is the vector and "T" its value_type:



    // 1)
    // requires T to be copyable
    // will make v copy all elements after "it", order...
  21. Replies
    48
    Views
    2,070

    Re: Is this guaranteed to be correct?

    wow, maybe a moderator warning could bring the dicussion to a more civil level, at least to avoid totally offtopic and psychiatric posts like the above. I doubt so though, having you already been...
  22. Re: how can I get rid of these downcasts?

    the problem is that you need so called multimethods but c++ does not have them, take a look here for a Bjarne's take on this issue.

    As the paper suggests, a common standard workaround is the...
  23. 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...
  24. Replies
    48
    Views
    2,070

    Re: Is this guaranteed to be correct?

    sadly nothing much to say ... just avoid off-topic non-technical offensive comments, please.
  25. Replies
    48
    Views
    2,070

    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...
Results 1 to 25 of 1173
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