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

  1. 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 );...
  2. 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(){...
  3. Replies
    5
    Views
    359

    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...
  4. 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...
  5. Replies
    7
    Views
    497

    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,...
  6. 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...
  7. 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.
  8. Replies
    7
    Views
    627

    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,...
  9. Replies
    7
    Views
    627

    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...
  10. Replies
    30
    Views
    1,335

    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...
  11. Replies
    30
    Views
    1,335

    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...
  12. Replies
    5
    Views
    394

    Re: How much memory allocated?

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

    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...
  14. Replies
    30
    Views
    1,335

    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...
  15. Replies
    7
    Views
    327

    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...
  16. Replies
    7
    Views
    397

    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...
  17. 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...
  18. 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...
  19. 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...
  20. 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...
  21. 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...
  22. 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...
  23. Replies
    9
    Views
    1,213

    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...
  24. Replies
    6
    Views
    1,392

    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...
  25. Replies
    8
    Views
    1,416

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