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

Search: Search took 0.07 seconds.

  1. 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.
  2. Replies
    7
    Views
    281

    Re: class taking integers or doubles

    templates ? that's not a good idea in this case; firstly, templates work at compile time but input works at runtime, so you'll essentially need (more or less) two code paths for every operations,...
  3. Replies
    7
    Views
    281

    Re: class taking integers or doubles

    you should elaborate first, that is,

    do you want a rational number from a string representation of a decimal number ? just extract all digits and divide by 10^<# of digits after the '.'>, ie...
  4. Replies
    30
    Views
    986

    Re: pros/cons on File I/O coding

    well, if this (really) is your (only) goal then there's no doubt, the OS apis will outperform both iostream and cstdio ( under the *same* conditions, see OReubens's posts on this ) being both layered...
  5. Replies
    30
    Views
    986

    Re: pros/cons on File I/O coding

    @2kaud, regarding the vector in your code snippet, I suppose you meant to reserve(10000000) not to construct them, don't you ? in any case, if the intent is to avoid allocations note that string's...
  6. Replies
    5
    Views
    320

    Re: How much memory allocated?

    what kind of library is it ? ( statically linked, ... )
  7. Replies
    7
    Views
    279

    Re: How to big structures across libraries

    it's hard to give any refactoring advice withouth knowing the purpose/domain of your library; could you post an example of a typical usage of your library functions/classes ( possibly showing a use...
  8. Replies
    30
    Views
    986

    Re: pros/cons on File I/O coding

    actually, IMO you're comparing different things: the io winapi ( and to a less extent cstdlib ) is essentially used to input/output sequences of bytes, whereas the iostream abstraction defines a...
  9. Replies
    7
    Views
    279

    Re: How to big structures across libraries

    dll ? or static ? ( it does matter, see below )

    VictorN's suggestion is great ( moreover, following winapi, the struct could have a first member containing the (known) size of the struct itself or...
  10. Replies
    7
    Views
    347

    Re: what happens when x = new int[0]?

    it may or may not be redundant, that code may *require* the size to be non zero, even if legally allowed ( for example, that code may appear in an algorithm requiring a never empty collection of ints...
  11. 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...
  12. 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...
  13. 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...
  14. 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...
  15. 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...
  16. 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...
  17. Replies
    9
    Views
    1,122

    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...
  18. Replies
    6
    Views
    1,363

    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...
  19. Replies
    8
    Views
    1,384

    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 )...
  20. Replies
    6
    Views
    1,363

    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...
  21. Replies
    8
    Views
    1,384

    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...
  22. Replies
    8
    Views
    1,384

    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,...
  23. Re: A faster algorithm than dijkstra's algorithm

    ... or define the length as minus the logarithm of the factor ;)
  24. 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 (...
  25. 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...
Results 1 to 25 of 1183
Page 1 of 48 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