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

Search: Search took 0.05 seconds.

  1. Re: concatenate int value from vector to long long int

    uhm, unless I'm missing something, no, because a reference to an automatic const int is not a constant expression ( triggering an implicit capture and hence an error ). Are you using a c++14 standard...
  2. Re: concatenate int value from vector to long long int

    AFAIK, clang is right because const int's ( and unscoped enumerations ) initialized by a constant expression are like constant expressions themselves when converted to rvalues ( eg. if no address is...
  3. Re: trying to use SFINAE to detect unimplemented abstract function

    off the top of my head, this should work ( and works on clang ), although it may not be very portable due to compilers idiosyncrasies concerning virtual member pointers ...



    #include <iostream>...
  4. Replies
    11
    Views
    541

    Re: Review Component Based Architecture API

    BTW, looking at the posted link, that emplace() call does look somewhat brittle, but for a different reason; that is, it's currently unspecifed whether the moved object is actually moved or not if...
  5. Replies
    11
    Views
    541

    Re: Review Component Based Architecture API

    no, it can't ( assuming cmp a unique_ptr ). emplace() takes both its arguments by reference perfect-forwarding them to the corresponding std:: pair constructor. So, indpendently of evaluation order,...
  6. Re: RAD Studio difference between i++ and ++i

    indeed, according to this ( as of now, accepted ) standard proposal due for c++17, order of evaluation will be fixed for postfix and assignment expressions ( but note that this won't affect the OP...
  7. Re: RAD Studio difference between i++ and ++i

    this doesn't make much sense to me; if your proposed language change aims at forcing the compiler to detect ALL such cases, then this is and always will be impossible in c++ ( consider an expression...
  8. Re: RAD Studio difference between i++ and ++i

    this is impossible, generally speaking. Trivial cases aside ( that are already signaled by compilers like clang ), the compiler cannot statically check all such cases due to aliasing issues.
    ...
  9. Replies
    9
    Views
    707

    Re: User defined literals

    first of all, you're using the user defined literal facility the other way around people would usually expect, that is, you write -20kel to actually mean -20 degrees celsius ...

    second, the '-' is...
  10. Replies
    4
    Views
    423

    Re: std::map::at() versus std::map::find()

    yep, map::at returns a reference to the element associated to the given key, or throws if none exists ( this is in contrast with operator[] that creates a new element in this case ).
  11. Re: order of argument evaluation of overloaded stream insertion operator

    just for clarity sake, it's worth noting that this can happen because cout's operator<<(int) takes its parameter by value, and parameter initialization is a part of parameter evaluation, so to speak....
  12. Re: Simple program executed without using return 0 in main?!

    indeed, int main() is so special that the language specifically allows omitting its return value, that in turn is simply assumed zero.
  13. Re: Inconsistency in the comparator outcome?

    I'd still check if the 'problem' is just a matter of textual output.

    I mean, unless the OP has expectations that go beyond what floating point has to offer ( like making assumptions about the...
  14. Re: Obtaining a value from a std::set and letting it be a variable.

    it's not "wrong", you just need to make sure that the set is not empty ( so that begin() is dereferenceable ) and that the pointed to object remains valid, that is until the set erases it.

    of...
  15. Replies
    12
    Views
    822

    Re: All possible combinations problem

    I mean, in order to increment a binary number in natural order you only need to search the first least significant zero bit, say, in 101010111 you check and flip only the first four bits on the right...
  16. Re: Inconsistency in the comparator outcome?

    maybe it's just a textual output problem, have you tried printing total_cost with more digits ?
  17. Replies
    12
    Views
    822

    Re: All possible combinations problem

    now, ignoring your very personal definition of bigO ...

    are you claiming that the number of output.replace() calls grows as N*2^N in the regular case and as 2^N in the Gray case ? this is also...
  18. Re: Linker error with pure virtual function.

    as a side note, you're probably using a non-standard implementation of std::thread here ( maybe, vs2013 implemented an early draft ? ) because destroying a detached std::thread will invoke...
  19. Re: warning C6386: Buffer overrun while writing to 'p->op'

    I doubt so, unless your real intent was to allocate memory for nops parseNode's for constructing nops parseNode pointers ... does not make much sense to me
  20. Replies
    12
    Views
    822

    Re: All possible combinations problem

    so,



    for( int c = 0; c < N; ++c )
    {
    if(is_bit_on_at(c))
    {
    flip_bit_at(c);
    break;
  21. Replies
    12
    Views
    822

    Re: All possible combinations problem

    the fact that you're changing just one bit does not mean you do it in O(1), you still need a time proportional to the number of max bits in a way or the other...
  22. Re: warning C6386: Buffer overrun while writing to 'p->op'

    as far as I can tell, I see three problems:

    1-if nops is negative you may end up allocating a lot of unused memory
    2-if nops is zero it may cause a "FatalError" or maybe not, it's implementation...
  23. Replies
    7
    Views
    477

    Re: stl nested maps

    here is the corresponding library defect issue

    anyway, note that O(n) "sorted insertions" are still guaranteed at container construction...
  24. Replies
    9
    Views
    539

    Re: Create a graph from a 2d char array

    ... uhm, why ? unless accessing the map by row/col is too costly for some reason ( you didn't show your "map" definition ), it's easy to enumerate a vertex neighbour, just lookup what's at...
  25. Replies
    6
    Views
    622

    Re: Code Structuring Advice Needed

    design issues aside, note that you cannot generally control globals initialization order across translation units; this means that if your globals depends on each other ( even after main() started )...
Results 1 to 25 of 1386
Page 1 of 56 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a Codeguru.com survey!


HTML5 Development Center