dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: superbonzo

Page 1 of 60 1 2 3 4

Search: Search took 0.80 seconds.

  1. Re: how to compress the code while getting the same results?

    >>Still I think it's fair to say that the routine splitting into .h and .cpp is a convention that is becoming increasingly obsolete.[...]I think it should rather be taught the other way around, that...
  2. Re: how to compress the code while getting the same results?

    In your case, it surely makes little sense to split everything in that way ( indeed, placing one-liners into cpp files would not even pass code review in some coding guidelines ).

    But claiming...
  3. Replies
    13
    Views
    2,003

    Re: How iterators are useful

    generally speaking, "dereferencing" means turning some kind of referee into its referent ( eg. the word 'apple' to a real apple, a postal address to a real house, an id-card to a real person, etc......
  4. Re: better program structure for mess of nested loops

    you could simply split the combination traversal/filtering/acting logics into different functions/classes.

    For example, a purely functional approach could be ( I made it non generic just to ease...
  5. Re: Do C++ programmers need to know Linux perfectly as well?

    nenver said that, actually I claimed the exact opposite.



    you missed the point; this has nothing to do with efficiency as such, it has to do with correctness, that is proving that some low...
  6. Re: Do C++ programmers need to know Linux perfectly as well?

    this is a wrong attitude in my opinion; C++ is not a ‘clever’ version of C, you don’t use one or the other based on how smart you are or on which fan you are of.

    C and C++ have different stregths...
  7. Replies
    13
    Views
    2,003

    Re: How iterators are useful

    iterators need not to be pointers, nor to belong to some container. An iterator is just something that can be traversed and dereferenced ( how and when depending on its iterator category ).
    For...
  8. Thread: Question

    by superbonzo
    Replies
    4
    Views
    1,063

    Re: Question

    moreover, the min/max standard family of functions also works with references, enabling things like



    auto bounds = std::minmax(a,b);

    bounds.first--; // say, decrement the minimum...
  9. Thread: Question

    by superbonzo
    Replies
    4
    Views
    1,063

    Re: Question

    do you mean, using only int/binary arithmetics ? take a look at http://graphics.stanford.edu/~seander/bithacks.html
  10. Replies
    1
    Views
    700

    Re: TCP Server programming in C++ & Linux?

    boost.asio is a modern and portable c++ solution. If you have no stringent performance requirements, it seems also node.js works on Raspberry for an easier alternative.



    what do you mean ? in...
  11. Re: Did rules for naming your files change?

    source file naming has never been part of the c++ specification; how #include<> or #include"" directives are interpreted ( both in terms of file location and character encoding ) is and always has...
  12. Re: Is there anyway to make this C-code faster?

    can you post the asm ? assuming you populated B and C randomly and uniformly, I'd guess the compiler vectorized the code via a gather addressing SIMD instruction in the first case ... BTW, in all...
  13. Re: Is there anyway to make this C-code faster?

    basically, "false sharing" occurs when two or more cores try to access different memory location lying in the same cache line; they look like being indipendent read/writes but turn out effectively...
  14. Re: Is there anyway to make this C-code faster?

    this means you’d need just 2 cycles on avarage to get a result as by post #7 given a random C with no repetitions; it’s highly unplausible for such a loop to run slower than a full C traversal. So,...
  15. Replies
    10
    Views
    4,957

    Re: How to mod an old game?

    no the source code is not strictly necessary and the ‘flawlessness’ of the mod has nothing to do with way it has been accomplished. As said, it depends. For example, it may suffice using a debugger...
  16. Re: Is there anyway to make this C-code faster?

    first of all, I’d follow wolle’s advice of exploiting ‘or’ properties, and adapt your data structures accordingly, eg. B and C seems a very inefficient choice ( how are B and C created/updated ? );...
  17. Replies
    10
    Views
    4,957

    Re: How to mod an old game?

    There's no 'usual' way of doing it, it all depends on the specific way the game were coded. Modifing it can be as simple as editing a ( more or less hidden ) configuration file, or going into full...
  18. Re: BOOST- undefined reference to `boost::system::generic_category()'

    boost::thread is not header only; you must compile it to your preferred architecture target and link ( either statically or dynamically ). alternatively, all major compilers supports std::thread now...
  19. Replies
    1
    Views
    713

    Re: What exaxctly does boost::bind do ??

    as far as I know, the main reason is to allow composition with nullary functions:



    int foo();
    void bar( int c );

    int main() {
    bar( foo() ); // this is the expression we want to bind
    ...
  20. Replies
    11
    Views
    2,522

    Re: How smart is the compiler?

    such a thing is optimized both at the compiler and at the processor level; the compiler can do dead code removal ( eg. to proove that <result> doesn't change and jump ahead, use lookup table, etc......
  21. Replies
    11
    Views
    2,522

    Re: How smart is the compiler?

    agreed, but only if those error conditions are truly exceptional … otherwise, if the errors are part of the expected program flow you’ll incur in the cost of stack unwinding, and you’ll need to...
  22. Replies
    18
    Views
    3,379

    Re: extern in macro

    I understand, my point is that using-declarations do not hide names ( as declarations do at namespace scope ), they'll just raise a compiler error when a clashing name exists, eg, if your cpp...
  23. Replies
    18
    Views
    3,379

    Re: extern in macro

    the problem is that it somewhat reduces the benefit of using a namespace in the first place ( that is, limiting name clashes ) ...
  24. Replies
    4
    Views
    1,370

    Re: Unable to compile C++ code

    you're allocating an array of billions bools on the stack ! your compiler is trying to optimize given the known array bounds, probably going out of memory during the process. Note that even if it...
  25. Replies
    18
    Views
    3,379

    Re: extern in macro

    this does not compile either ( in clang ), and I'm pretty confident that it's non standard because simple declarators cannot be qualified names; I don't think it's bug though, probably it's just one...
Results 1 to 25 of 1482
Page 1 of 60 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)