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

Search: Search took 0.04 seconds.

  1. Replies
    3
    Views
    1,799

    Re: WndProc break or return

    it doesn't matter whether you return or break ( and return later ) as long as you follow the documentation of the message regarding the expected return value and meaning. Maybe, the author of the...
  2. Re: Check if a given 8 byte is a valid double

    what do you mean ? note that the OP asked for testing an arbitrary 8-byte chunck of which we don't know where it comes from ...



    I also don't get this. the point of my post was not to claim...
  3. Replies
    7
    Views
    515

    Re: reference to const

    the reference is initialized with a qlist whose lifetime will not survive the Device ctor body ( or an exception thereof). Note that the usual lifetime extension of temporaries when bound to const&...
  4. Re: Check if a given 8 byte is a valid double

    denormals are in "the valid range" so why exclude them ? moreover, infinities and nans are also "valid" in a sense and given that the OP asked for converting an "8-byte data block" to a double, I...
  5. Replies
    3
    Views
    331

    Re: exceeded 32bit register

    really ? the OP specifically said "I made sure that I use long long as my interger type." which is guaranteed to give the correct result for the numbers above; yes, he also mentions a "32 bit...
  6. Replies
    3
    Views
    331

    Re: exceeded 32bit register

    please, post a minimal, complete code sample replicating the problem, with the output you expect. Note that the following



    #include <iostream>

    int main()
    {
    long long a = 0xFA062F2F;
    ...
  7. Replies
    7
    Views
    515

    Re: reference to const

    not a good idea, you're creating a dangling reference. Anyway,



    define "not applicable"; note that making the reference/pointer "nullable" increases code complexity ( you need to check that...
  8. Re: passing an array as a pointer to a function

    oooh, now they are both allocated from the same memory :rolleyes: ... so, the fact that you're comparing an automatic array and a free store array ( via std::vector ) in post #19 was just an...
  9. Re: passing an array as a pointer to a function

    uhm, why ? conceptually, whether the array is zeroed or not does not make a difference in this case ... of course, this may end up making the compiler to opt out for this or that optimization, but
    ...
  10. Re: passing an array as a pointer to a function

    nope, here is a vector-less version showing the same phenomenon:



    #include <iostream>
    #include <ctime>

    int sptr[10] = {};
    int* cptr = new int[10];
  11. Re: passing an array as a pointer to a function

    the issue is not whether a dereference conceptually occurs or not, the point is if such a dereference implies a memory access to the pointer value or not.



    the fact that is theorically...
  12. Replies
    5
    Views
    450

    Re: initializing a POD bitfield struct

    yes it is ( or not, see below :) ), s() ( and s{} in c++11 ) denotes value-initialization that for POD types means zero-initialization.

    That said, AFAIR not all c++03 compilers actually follow the...
  13. Replies
    47
    Views
    5,160

    Re: Ising Model C++ Metropolis Algorithm

    you can't ( you can't choose spins randomly and indipendently *and* at the same time enforce non repetitions as this will define a dependency between spins ) why do you have such a requirement ? it's...
  14. Replies
    1
    Views
    231

    Re: Detect protected destructor?

    std::is_destructible will work ( on c++11 compliant compilers; of course, it would return true for deleted and private destructors as well ); regarding C++03 support, a SFINAE based solution may work...
  15. Re: How to read the tag name of boost ptree?

    ... just read the doc. Quoting page 1:



    so, your xml snippet will have the (pseudocodish) structure:



    ptree{"",
    list{
  16. Re: Not sure why values are changing when I'm passing arrays and array sizes

    function parameters declared as arrays are always parsed as pointers in c++ ( no conversion or pointer decay, you just cannot declare an array as function parameter ), so

    void f(int[3]);
    void...
  17. Replies
    18
    Views
    4,814

    Re: Linear search using recursive function

    ... unless it is a functional programming course where immutability is a requirement and loop-like imperative solutions are not possible even in principle. That said, I too wonder what's the point of...
  18. Re: Constructor with functional / construction via lambda

    it's not undefined, it's just that "b" has not been constructed yet and has an indeterminate value ( note that something similar happens <during> construction anyway ).

    Indeed, playing with my vs...
  19. Re: Constructor with functional / construction via lambda

    it(*) compiles fine in latest gcc and clang as it should. I'd guess it's a vc++ bug/feature :)

    (*) this is the simplified snippet I just tested:



    struct B{ template<class T> B(T&&) {} void...
  20. Re: Constructor with functional / construction via lambda

    a lambda expression simply defines a functor ( the closure type ) in the smallest viable scope containing it and returns a ( properly initialized ) pure rvalue of its closure type; name lookup in the...
  21. Replies
    7
    Views
    487

    Re: boost attribute question

    sure, but boost.property_tree indeed has only VERY simplistic xml support ( it uses streams internally for everything, has no xmlencoding support, no entities etc ... ), and the OP used it from the...
  22. Replies
    7
    Views
    487

    Re: boost attribute question

    the easiest way is to construct the xml directly, off the top of my head ( not tested ):



    void stick(wptree& tree, std::wstring location, Point2 p, std::size_t id )
    {
    std::wstringstream...
  23. Re: Why is the CRTP used instead of virtual functions?

    no, I never argued about compilation speed ( the compiler will simply give up an optimization route if it sees the time will explode; so, this has nothing to do with compilation speed, but with the...
  24. Re: Why is the CRTP used instead of virtual functions?

    that devirtualization case is trivial and has been implemented by compilers for ages. But, devirtualizing all possibly statically resolved virtual calls requires a lot of work from the compiler,...
  25. Re: Why is the CRTP used instead of virtual functions?

    first of all, you're confusing two different goals: one is to let the compiler generate code avoiding code repetition, this is the main goal of CRTP; the other one is to inject code at compile time...
Results 1 to 25 of 1105
Page 1 of 45 1 2 3 4


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center