¡@

Home 

c++ Programming Glossary: don't

Do-While and if-else statements in C/C++ macros

http://stackoverflow.com/questions/154136/do-while-and-if-else-statements-in-c-c-macros

#define BAR X do int i f X if i 4 g i while 0 You don't have to use do ... while you could cook up something with if..

What uses are there for “placement new”?

http://stackoverflow.com/questions/222557/what-uses-are-there-for-placement-new

efficient to allocate more than you need even though you don't want to use it yet. Devex gives a good example Standard C also..

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

are reserved for additional type names. Personally I just don't start identifiers with underscores. New addition to my rule..

Is it possible to write a C++ template to check for a function's existence?

http://stackoverflow.com/questions/257288/is-it-possible-to-write-a-c-template-to-check-for-a-functions-existence

it uses it otherwise it doesn't. The magical part that I don't know how to do is the FUNCTION_EXISTS part. c templates sfinae.. return 0 I've just tested it with Linux and gcc 4.1 4.3. I don't know if it's portable to other platforms running different compilers...

Regular cast vs. static_cast vs. dynamic_cast

http://stackoverflow.com/questions/28002/regular-cast-vs-static-cast-vs-dynamic-cast

place but there seem to be two other types of casts and I don't know the difference. What's the difference between the following.. dynamic_cast dynamic_cast is used for cases where you don't know what the dynamic type of the object is. You cannot use..

What is move semantics?

http://stackoverflow.com/questions/3106110/what-is-move-semantics

excited about C 0x now with the exception of one. I still don't get move semantics ... What is it exactly c c faq c 11 move.. client detect that the source had been modified. Since we don't really do a copy here we call this constructor a move constructor.. that's it Where's the rvalue reference you might ask. We don't need it here is my answer Note that we pass the parameter that..

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

true if they sample the entire call stack. Call graphs don't give you the same information because 1 they don't summarize.. graphs don't give you the same information because 1 they don't summarize at the instruction level and 2 they give confusing.. time and thus costs that much . For simplicity suppose we don't know what f is but assume it is either 0.1 0.2 0.3 ... 0.9 1.0..

Pretty-print C++ STL containers

http://stackoverflow.com/questions/4850473/pretty-print-c-stl-containers

namespace std Pre declarations of container types so we don't actually have to include the relevant headers if not needed.. thanks to Xeo Add namespaces so that the helper classes don't bleed into the global namespace. Done Add template aliases or.. namespace std Pre declarations of container types so we don't actually have to include the relevant headers if not needed..

What are the barriers to understanding pointers and what can be done to overcome them?

http://stackoverflow.com/questions/5727/what-are-the-barriers-to-understanding-pointers-and-what-can-be-done-to-overcome

It is best to think of a pointer as a black box ie. you don't really know or care about how it is actually implemented just..

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

be parsed Usually for simple languages for parsing you don't need to know the meaning of a name but can just grammatically..

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

to die in an explosion while you are sneaking around. You don't know what is going to happen when you checked out of the hotel..

What are the differences between struct and class in C++

http://stackoverflow.com/questions/92859/what-are-the-differences-between-struct-and-class-in-c

in OO design. I'll start with an obvious difference If you don't specify public or private members of a struct are public by..

C++ Singleton design pattern

http://stackoverflow.com/questions/1008019/c-singleton-design-pattern

get copies of your singleton appearing. S S const Don't Implement void operator S const Don't implement See this article.. S S const Don't Implement void operator S const Don't implement See this article about when to use a singleton not..

Calling Objective-C method from C++ method?

http://stackoverflow.com/questions/1061005/calling-objective-c-method-from-c-method

_impl logMyMessage Hello Arthur else _impl logMyMessage Don't worry. You now access calls to MyClass through a private implementation..

What is the difference between NULL, '\0' and 0

http://stackoverflow.com/questions/1296843/what-is-the-difference-between-null-0-and-0

if the string pointer is pointing at a non null character Don't get these confused with null pointers. Just because the bit..

How do you pass a member function pointer?

http://stackoverflow.com/questions/130322/how-do-you-pass-a-member-function-pointer

the function using both pointers ButtonObj ButtonFunc Don't forget to pass the pointer to your object to MenuButton SetButton..

Why use pointers? [closed]

http://stackoverflow.com/questions/162941/why-use-pointers

Why use pointers over normal variables Short answer is Don't. Pointers are to be used where you can't use anything else...

What is “cache-friendly” code?

http://stackoverflow.com/questions/16699247/what-is-cache-friendly-code

clip thanks to @Mohammad Ali Baydoun for the link . Don't neglect the cache in data structure and algorithm design Whenever..

When should I write the keyword 'inline' for a function/method?

http://stackoverflow.com/questions/1759300/when-should-i-write-the-keyword-inline-for-a-function-method

not write the keyword 'inline' for a function method in C Don't add inline when you think your code will run faster if the compiler..

C++ delete - It deletes my objects but I can still access the data?

http://stackoverflow.com/questions/1930459/c-delete-it-deletes-my-objects-but-i-can-still-access-the-data

expected This is technically known as Undefined Behavior. Don't be surprised if it offers you a can of beer either. share improve..

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

identifiers with underscores. New addition to my rule Don't use double underscores anywhere which is easy as I rarely use..

Does the size of an int depend on the compiler and/or processor?

http://stackoverflow.com/questions/2331751/does-the-size-of-an-int-depend-on-the-compiler-and-or-processor

the practical usefulness of that implementation would end. Don't expect to see something like that in a normal C C compiler...

Dynamically allocating an array of objects

http://stackoverflow.com/questions/255612/dynamically-allocating-an-array-of-objects

A const copy mSize copy.mSize mArray new int copy.mSize Don't need to worry about copying integers. But if the object has..

Read whole ASCII file into C++ std::string

http://stackoverflow.com/questions/2602013/read-whole-ascii-file-into-c-stdstring

STL idioms well is actually surprisingly inefficient Don't do this with large files. See http insanecoding.blogspot.com..

How to implement big int in C++

http://stackoverflow.com/questions/269268/how-to-implement-big-int-in-c

to consider for a big int class Mathematical operators Don't forget that your class may be on either side of the operator..

Pretty-print C++ STL containers

http://stackoverflow.com/questions/4850473/pretty-print-c-stl-containers

TChar TCharTraits operator const T value if _delim NULL Don't insert a delimiter if this is the first time the function is..

Accessing class members on a NULL pointer

http://stackoverflow.com/questions/669742/accessing-class-members-on-a-null-pointer

Exotic architectures the standards committees care about

http://stackoverflow.com/questions/6971886/exotic-architectures-the-standards-committees-care-about

and data sizeof char sizeof int maybe not word addressed Don't know if they offer a C compiler though but they could . share..

Is there any real risk to deriving from the C++ STL containers?

http://stackoverflow.com/questions/922248/is-there-any-real-risk-to-deriving-from-the-c-stl-containers

to be implemented. The positive advantages to A include Don't have to provide trivial implementations of constructors etc..

Why does changing 0.1f to 0 slow down performance by 10x?

http://stackoverflow.com/questions/9314534/why-does-changing-0-1f-to-0-slow-down-performance-by-10x

just round to zero instead. Timings Core i7 920 @ 3.5 GHz Don't flush denormals to zero. 0.1f 0.564067 0 26.7669 Flush denormals..

What XML parser should I use in C++?

http://stackoverflow.com/questions/9387610/what-xml-parser-should-i-use-in-c

It has no real dependencies. It uses the Apache license. I Don't Care About DOM and or SAX Conformance You have chosen LibXML2..