c++ Programming Glossary: obviously
Why aren't my include guards preventing recursive inclusion and multiple symbol definitions? http://stackoverflow.com/questions/14909997/why-arent-my-include-guards-preventing-recursive-inclusion-and-multiple-symbol I keep getting errors about non existing symbols which are obviously there or even weirder syntax errors every time I write something..
Difference between A* pA = new A; and A* pA = new A(); http://stackoverflow.com/questions/1581763/difference-between-a-pa-new-a-and-a-pa-new-a new A will value initialize the new A object. This is obviously different behaviour for POD types but also affects non POD non..
Uses of C comma operator http://stackoverflow.com/questions/1613230/uses-of-c-comma-operator As an additional note the very design of the language is obviously tailored towards statements. Statements can freely invoke expressions..
Why is `i = ++i + 1` unspecified behavior? http://stackoverflow.com/questions/1860461/why-is-i-i-1-unspecified-behavior arguments is important to evaluation. For example i i is obviously undefined. Please consider only my case i i 1 . Why does the..
Get the IP address of the machine http://stackoverflow.com/questions/212528/get-the-ip-address-of-the-machine but where To make things a bit clearer The server will obviously have the localhost 127.0.0.1 The server will have an internal..
How does C compute sin() and other math functions? http://stackoverflow.com/questions/2284860/how-does-c-compute-sin-and-other-math-functions slower even though I think my algorithms are pretty clever obviously they're not . c c math share improve this question In GNU..
Dynamically allocating an array of objects http://stackoverflow.com/questions/255612/dynamically-allocating-an-array-of-objects share improve this question For building containers you obviously want to use one of the standard containers such as a std vector..
Regular cast vs. static_cast vs. dynamic_cast http://stackoverflow.com/questions/28002/regular-cast-vs-static-cast-vs-dynamic-cast of these languages that I've never really understood. I've obviously used regular casts i.e. MyClass m MyClass ptr all over the place..
How do exceptions work (behind the scenes) in c++ http://stackoverflow.com/questions/307610/how-do-exceptions-work-behind-the-scenes-in-c simply because an exception might be thrown there is obviously a lot of overhead in actually throwing and catching an exception...
Erasing elements from a vector http://stackoverflow.com/questions/347441/erasing-elements-from-a-vector myNmbers.push_back i erase myNmbers 1 return 0 This code obviously crashes because I am changing the end of the vector while iterating..
C++11 rvalues and move semantics confusion http://stackoverflow.com/questions/4986673/c11-rvalues-and-move-semantics-confusion int rval_ref return_vector except that in my rewrite you obviously can't use rval_ref in a non const manner. Second example std..
What makes more sense - char* string or char *string? [duplicate] http://stackoverflow.com/questions/558474/what-makes-more-sense-char-string-or-char-string see the latter format. This applies to references as well obviously. Could someone tell me if there is a logical reason for the..
Developing Internet Explorer Extensions? http://stackoverflow.com/questions/5643819/developing-internet-explorer-extensions Most modern browsers you use window.localStorage but obviously with IE8 IE7 that's not an option. Maybe a SQLite DB or such..
Can a local variable's memory be accessed outside its scope? http://stackoverflow.com/questions/6441218/can-a-local-variables-memory-be-accessed-outside-its-scope drawer inaccessible if you haven't rented the room Well obviously that scenario can happen in the real world no problem. There..
Unicode encoding for string literals in C++11 http://stackoverflow.com/questions/6796157/unicode-encoding-for-string-literals-in-c11 will return the number of code units not code points. And obviously the C standard library string functions are totally useless..
How to Compile for OS X in Linux or Windows? http://stackoverflow.com/questions/693952/how-to-compile-for-os-x-in-linux-or-windows
how to achieve 4 FLOPs per cycle http://stackoverflow.com/questions/8389648/how-to-achieve-4-flops-per-cycle Now for some explanations The performance critical part is obviously the 48 instructions inside the inner loop. You'll notice that..
Which kind of pointer do I use when? http://stackoverflow.com/questions/8706192/which-kind-of-pointer-do-i-use-when long as you don't use operations that need copyable types obviously . Note again that Boost has an array version scoped_array which..
Why can't variables be declared in a switch statement? http://stackoverflow.com/questions/92396/why-cant-variables-be-declared-in-a-switch-statement much anywhere and declaring them close to first use is obviously a good thing but the following still won't work switch val case..
Take the address of a one-past-the-end array element via subscript: legal by the C++ Standard or not? http://stackoverflow.com/questions/988158/take-the-address-of-a-one-past-the-end-array-element-via-subscript-legal-by-the pointer is not even allowed to exist which means you're obviously not allowed to dereference it either. Here's what the standard..
Algorithm improvement for Coca-Cola can shape recognition http://stackoverflow.com/questions/10168686/algorithm-improvement-for-coca-cola-can-shape-recognition would represent the pixels that match this threshold. Obviously there is still a lot of crap in the image but this reduces the..
Passing shared pointers as arguments http://stackoverflow.com/questions/10826541/passing-shared-pointers-as-arguments function will need to make a copy of a shared_ptr correct Obviously. So I pass it by a reference to const and copy to a local variable..
Any reason to overload global new and delete? http://stackoverflow.com/questions/1152511/any-reason-to-overload-global-new-and-delete allocators in C most of which are still very relevant. Obviously if you can use any of these fine tools you will want to do so..
throwing exceptions out of a destructor http://stackoverflow.com/questions/130117/throwing-exceptions-out-of-a-destructor it make sense to throw an exception out of the destructor Obviously these kinds of errors are rare but possible. c exception destructor..
std::function vs template http://stackoverflow.com/questions/14677997/stdfunction-vs-template while function s cover the internals via virtual calls. Obviously templates have their issues as I see them they have to be provided..
How to pass parameters correctly? http://stackoverflow.com/questions/15600499/how-to-pass-parameters-correctly CreditCard cc 12345 2 2015 1001 Account acc asdasd 345 cc Obviously the credit card will be copied twice in this scenario. If I..
When should functions be member functions? http://stackoverflow.com/questions/1638394/when-should-functions-be-member-functions that should be exploited I think it should be discouraged. Obviously this is only possible in a language like C that is not pure..
C++: std::string in a multi-threaded program http://stackoverflow.com/questions/1661154/c-stdstring-in-a-multi-threaded-program and portably use std string in a multi threaded program Obviously no STL data structure is thread safe. But at least with std..
Get the IP address of the machine http://stackoverflow.com/questions/212528/get-the-ip-address-of-the-machine find the external IP address to bind my application to it. Obviously I can also bind to INADDR_ANY and actually that's what I do..
Why don't C++ compilers define operator== and operator!=? http://stackoverflow.com/questions/217911/why-dont-c-compilers-define-operator-and-operator performing a member by member comparison be a problem Obviously if the class allocates memory then you'd want to be careful..
Why does this program crash: passing of std::string between DLLs http://stackoverflow.com/questions/2322095/why-does-this-program-crash-passing-of-stdstring-between-dlls main A a std string s a.getString return 0 crash on exit Obviously this is due to the different memory models for the executable..
What is the lifetime of a static variable in a C++ function? http://stackoverflow.com/questions/246564/what-is-the-lifetime-of-a-static-variable-in-a-c-function and this flag is checked on every entry to the function. Obviously this is a small performance hit but what's more of a concern..
C++ - passing references to boost::shared_ptr http://stackoverflow.com/questions/327573/c-passing-references-to-boostshared-ptr shared_ptr void send_message std shared_ptr std string msg Obviously that can be changed to void send_message const std shared_ptr..
C++ - enum vs. const vs. #define http://stackoverflow.com/questions/4767667/c-enum-vs-const-vs-define 1 int y WIDTH s error 2 int z Width s error 3 return 0 Obviously each multiplication results in compilation error but see how..
How to implement the factory pattern in C++ correctly http://stackoverflow.com/questions/5120768/how-to-implement-the-factory-pattern-in-c-correctly it both from both Cartesian and polar coordinates. Obviously I cannot do struct Vec2 Vec2 float x float y Vec2 float angle..
C++ Header order http://stackoverflow.com/questions/614302/c-header-order What order should headers be declared in a header cpp file Obviously those that are required by subsequent headers should be earlier..
What can I do with a moved-from object? http://stackoverflow.com/questions/7027523/what-can-i-do-with-a-moved-from-object object b std move c line 3 assignment to moved from object Obviously it must be possible to assign to moved from objects otherwise..
Can I list-initialize a vector of move-only type? http://stackoverflow.com/questions/8468774/can-i-list-initialize-a-vector-of-move-only-type int std vector move_only v move_only move_only move_only Obviously that cannot work because std unique_ptr is not copyable error..
Boolean expression (grammar) parser in c++ http://stackoverflow.com/questions/8706356/boolean-expression-grammar-parser-in-c and_ xor_ or_ simple expr_ Operating on the syntax tree Obviously you'd want to evaluate the expressions. For now I decided to..
|