Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums


Type: Posts; User: superbonzo

Page 1 of 44 1 2 3 4

Search: Search took 0.05 seconds.

  1. Replies

    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...
  2. Replies

    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...
  3. Replies

    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...
  4. 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:

  5. 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]);
  6. Replies

    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...
  7. 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...
  8. 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...
  9. 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...
  10. Replies

    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...
  11. Replies

    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 )
  12. 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...
  13. 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,...
  14. 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...
  15. Re: Variadic templates and type composition

    template <typename... Args>
    class C: public A<B<Args>...>

    when appearing where a parameter pack can be used ( and in other contexts too ), packs expansions ( eg, an expression E followed...
  16. Replies

    Re: Pure virtuals and construction order

    you could use a variant of the base from member idiom to enforce construction order ( never used myself, but at least it should qualify as "well known" :) ).

    That said, I had a similar problem...
  17. Re: If I have installed cygwin, do I have to install mingw in order to use DirectX?

    no, OpenGL is implemented as a direct3d wrapper on windows, in this sense is a layer on top of directx with the obvious costs. That said, the two apis are so similar nowadays that it's not surpring...
  18. Re: Long Division Output using Vectors of Chars Outputs Garbage

    a C++ incompatible with C ? oh my ! it would have been a total disaster ... C is a great language for low level programming with portable and easy to code compilers/libraries/ABIs... and it's a...
  19. Replies

    Re: Multiple thread question

    .. but they're movable if you have a c++11 compiler, so a vector<fstream> would be ok in that case.
  20. Replies

    Re: Multiple thread question

    ehm, why not ? it should be very simple to quickly test if this is the case; it's just a matter of splitting a loop in two, isn't it ? in any case, you can also perform the whole thing a fixed number...
  21. Replies

    Re: Multiple thread question

    exactly, then the serial code wil do <get_file,parse_file,get_file,...> while a thread pool with a single worker will do...
  22. Replies

    Re: Multiple thread question

    ... uhm, but the very next sentence reads "Note that your application can improve its performance by keeping the number of worker threads low"... God knows :)

    unless each thread decides on his...
  23. Replies

    Re: Multiple thread question

    for curiosity sake, did you tried using the WT_SET_MAX_THREADPOOL_THREADS(Flags,Limit) macro to set Limit to just one thread to see if the problem was in the original code ? or simply measure the...
  24. Re: How to copy strings from file into array of pointers

    I totally agree with your conclusions, but not with your premise.

    I think the distinction between <what> something does and <how> something works is artificial and not very useful, I'd say it's...
  25. Thread: P = np

    by superbonzo

    Re: P = np

    >>They are transition probabilities, but the "conditional" part is most likely not true

    Firtsly, "conditional" means conditional with respect to the choice of an observable ( aka, an Hilbert space...
Results 1 to 25 of 1094
Page 1 of 44 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.


HTML5 Development Center