¡@

Home 

c++ Programming Glossary: other

What is an undefined reference/unresolved external symbol error and how do I fix it?

http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix

that use that .lib if any . Similar mechanism exist for other compilers platforms. Common error messages are error LNK2001..

What are the rules about using an underscore in a C++ identifier?

http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier

with an underscore and either an uppercase letter or another underscore are always reserved for any use. All identifiers.. associated headers is included unless explicitly stated otherwise see 7.1.4 . All identifiers with external linkage in any.. space if any of its associated headers is included. No other identifiers are reserved. If the program declares or defines..

What is the copy-and-swap idiom?

http://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom

Let's consider a concrete case. We want to manage in an otherwise useless class a dynamic array. We start with a working constructor.. int mSize 0 copy constructor dumb_array const dumb_array other mSize other.mSize mArray mSize new int mSize 0 note that this.. copy constructor dumb_array const dumb_array other mSize other.mSize mArray mSize new int mSize 0 note that this is non throwing..

What can I use to profile C++ code in Linux?

http://stackoverflow.com/questions/375913/what-can-i-use-to-profile-c-code-in-linux

of the number of times it may occur within a sample. Another objection I often hear is It will stop someplace random and.. how it works. Suppose there is some instruction I call or otherwise which is on the call stack some fraction f of the time and.. we assume P f 0.1 is .991 nearly certain and all the other possibilities are almost impossible 0.001 . In other words our..

Operator overloading

http://stackoverflow.com/questions/4421706/operator-overloading

However the users of your type will expect all the other operators to be present too so if you define operator be sure.. rule of operator overloading and also define all the other boolean comparison operators. The canonical way to implement.. that only two of these operators actually do anything the others are just forwarding their arguments to either of these two..

How do I use arrays in C++?

http://stackoverflow.com/questions/4810664/how-do-i-use-arrays-in-c

in the face of exceptions but that is the topic of another FAQ . Note This is meant to be an entry to Stack Overflow's.. types that have absolutely nothing to do with each other. sizeof T n is equivalent to n sizeof T . Array to pointer decay.. array of any size. Con Given a pointer to the first or any other element of an array there is no way to detect how large that..

How do I convert between big-endian and little-endian values in C++?

http://stackoverflow.com/questions/105252/how-do-i-convert-between-big-endian-and-little-endian-values-in-c

endian floats on big endian machines and vice versa. Other compilers have similar intrinsics as well. In GCC for example..

Benefits of Initialization lists

http://stackoverflow.com/questions/1598967/benefits-of-initialization-lists

Fred Fred x_ whatever if x is an object of a custom class. Other than that this style is used even with built in types for the..

Is it okay to inherit implementation from STL containers, rather than delegate?

http://stackoverflow.com/questions/2034916/is-it-okay-to-inherit-implementation-from-stl-containers-rather-than-delegate

mySpecialMethod arguments... private MyCollection coll_ Other domain specific member variables used in conjunction with the.. inheriting them&mdash but in some cases that's a big if. Other drawbacks include clashing with implementation specifics and..

Developing C wrapper API for Object-Oriented C++ code

http://stackoverflow.com/questions/2045774/developing-c-wrapper-api-for-object-oriented-c-code

in pure functions Member functions are pure functions. Other builtins are mapped to C equivalents where possible. So a class..

C++: Easiest way to initialize an STL vector with hardcoded elements

http://stackoverflow.com/questions/2236197/c-easiest-way-to-initialize-an-stl-vector-with-hardcoded-elements

30 Though I could shorten it using macro magic... Other ideas c stl vector initialization stdvector share improve..

Undefined, unspecified and implementation-defined behavior

http://stackoverflow.com/questions/2397984/undefined-unspecified-and-implementation-defined-behavior

undefined behavior then it's undefined behavior period. Other examples of undefined behavior include accessing an array beyond..

What's a very easy C++ profiler (VC++)?

http://stackoverflow.com/questions/2624667/whats-a-very-easy-c-profiler-vc

have team edition you can use the Visual Studio profiler . Other options Otherwise check this thread . Creating your own easily.. you can use the Visual Studio profiler . Other options Otherwise check this thread . Creating your own easily I personally..

C++ Timer function to provide time in nano seconds

http://stackoverflow.com/questions/275004/c-timer-function-to-provide-time-in-nano-seconds

Synchronizing across processors is still an issue. Other fine reading related to timers https blogs.oracle.com dholmes..

Operator overloading

http://stackoverflow.com/questions/4421706/operator-overloading

always has the implicit this argument of member functions. Other than this it can be overloaded to take any number of additional..

Polymorphism in c++

http://stackoverflow.com/questions/5854581/polymorphism-in-c

double n_ void f Base x x 2 run time polymorphic dispatch Other related mechanisms Compiler provided polymorphism for builtin.. to by requiring matching member function declarations Other mechanisms supporting polymorphism As promised for completeness..

Why should the “PIMPL” idiom be used?

http://stackoverflow.com/questions/60570/why-should-the-pimpl-idiom-be-used

cat_ Handle public Cat Constructor ~Cat Destructor Other operations... Purr CPP file #include cat.h class Cat CatImpl..

Where and why do I have to put the “template” and “typename” keywords?

http://stackoverflow.com/questions/610245/where-and-why-do-i-have-to-put-the-template-and-typename-keywords

well as the typename and template disambiguation keywords. Other aspects should be handled in another answer or another FAQ entry...

How to determine CPU and memory consumption from inside a process?

http://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process

WIN32 API I just list them here for completeness. Others however need to be obtained from the Performance Data Helper.. lastUserCPU timeSample.tms_utime return percent TODO Other Platforms I would assume that some of the Linux code also works..

Why should `new` be used as little as possible?

http://stackoverflow.com/questions/6500313/why-should-new-be-used-as-little-as-possible

and both will be released at the end of the program. Other notes Extensive use of RAII is considered a best practice in..

What does it mean to have an undefined reference to a static member?

http://stackoverflow.com/questions/7092765/what-does-it-mean-to-have-an-undefined-reference-to-a-static-member

Rule for static data members of class templates. Other uses of static When the static keyword is applied to functions..

how to achieve 4 FLOPs per cycle

http://stackoverflow.com/questions/8389648/how-to-achieve-4-flops-per-cycle

However if grouped in 3's it suddenly works like magic. Other architectures possibly Sandy Bridge and others appear to be..

Eclipse CDT C++11/C++0x support

http://stackoverflow.com/questions/9131763/eclipse-cdt-c11-c0x-support

Build Settings Tool Settings GCC C Compiler Miscellaneous Other Flags. Put std c 0x at the end . ... instead of GCC C Compiler..