Search:
Type: Posts; User: superbonzo
Search:
Search took 0.12 seconds.
-
October 29th, 2017, 03:36 AM
>>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...
-
October 28th, 2017, 04:06 AM
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...
-
October 24th, 2017, 03:51 AM
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......
-
October 20th, 2017, 02:38 AM
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...
-
October 17th, 2017, 02:01 AM
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...
-
October 16th, 2017, 03:48 AM
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...
-
October 16th, 2017, 03:12 AM
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...
-
September 17th, 2017, 03:37 AM
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...
-
September 16th, 2017, 05:31 AM
do you mean, using only int/binary arithmetics ? take a look at http://graphics.stanford.edu/~seander/bithacks.html
-
September 13th, 2017, 02:02 AM
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...
-
September 3rd, 2017, 10:22 AM
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...
-
September 1st, 2017, 03:17 PM
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...
-
September 1st, 2017, 03:11 PM
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...
-
September 1st, 2017, 11:19 AM
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,...
-
September 1st, 2017, 03:14 AM
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...
-
September 1st, 2017, 02:15 AM
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 ? );...
-
August 30th, 2017, 02:51 AM
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...
-
August 27th, 2017, 01:48 AM
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...
-
August 23rd, 2017, 07:31 AM
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
...
-
August 16th, 2017, 10:19 AM
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......
-
August 16th, 2017, 10:12 AM
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...
-
July 25th, 2017, 03:55 PM
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...
-
July 24th, 2017, 03:08 PM
the problem is that it somewhat reduces the benefit of using a namespace in the first place ( that is, limiting name clashes ) ...
-
July 23rd, 2017, 08:34 AM
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...
-
July 23rd, 2017, 04:45 AM
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...
|
Click Here to Expand Forum to Full Width
|