¡@

Home 

c++ Programming Glossary: shouldn't

what is the difference between const int*, const int * const, int const *

http://stackoverflow.com/questions/1143262/what-is-the-difference-between-const-int-const-int-const-int-const

the string itself is in the data segment of a program and shouldn't be changed. bar is a const or fixed pointer to a value that..

C++ Accesses an Array out of bounds gives no error, why?

http://stackoverflow.com/questions/1239938/c-accesses-an-array-out-of-bounds-gives-no-error-why

code is correct you don't need bounds checking and you shouldn't be forced to pay for the overhead of runtime bounds checking...

What are copy elision and return value optimization?

http://stackoverflow.com/questions/12953127/what-are-copy-elision-and-return-value-optimization

rely on a specific number of destructors being called. You shouldn't have critical logic inside copy move constructors or destructors..

How come a non-const reference cannot bind to a temporary object?

http://stackoverflow.com/questions/1565600/how-come-a-non-const-reference-cannot-bind-to-a-temporary-object

rvalue is explicit so it's allowed ... Basically you shouldn't try to modify temporaries for the very reason that they are..

Why can you return from a non-void function without returning a value without producing a compiler error?

http://stackoverflow.com/questions/1610030/why-can-you-return-from-a-non-void-function-without-returning-a-value-without-pr

that you can issue compiler flags to produce a warning but shouldn't it always be an error Why does it make sense for a non void..

Variable number of arguments in C++?

http://stackoverflow.com/questions/1657883/variable-number-of-arguments-in-c

c varargs share improve this question You probably shouldn't and you can probably do what you want to do in a safer and simpler..

Is it good practice to NULL a pointer after deleting it?

http://stackoverflow.com/questions/1931126/is-it-good-practice-to-null-a-pointer-after-deleting-it

around in user code you're Doing It Wrong. The pointer shouldn't be there to point to garbage in the first place. Why isn't there..

What should main() return in C and C++?

http://stackoverflow.com/questions/204476/what-should-main-return-in-c-and-c

void main is explicitly prohibited by the C standard and shouldn't be used. The valid C main signatures are int main and int main..

Windows threading: _beginthread vs _beginthreadex vs CreateThread C++

http://stackoverflow.com/questions/331536/windows-threading-beginthread-vs-beginthreadex-vs-createthread-c

I used _beginthread but if I call _endthread in the thread shouldn't that work What's the deal there c c multithreading winapi ..

Thou shalt not inherit from std::vector

http://stackoverflow.com/questions/4353203/thou-shalt-not-inherit-from-stdvector

developers are competent enough to understand that this shouldn't be used polymorphically anyway. Is my decision absolutely unjustifiable..

What C++ Smart Pointer Implementations are available?

http://stackoverflow.com/questions/5026197/what-c-smart-pointer-implementations-are-available

. It takes ownership of the pointer so two auto pointers shouldn't contain the same object. Assignment will transfer ownership..

What is the C++ iostream endl fiasco?

http://stackoverflow.com/questions/5492380/what-is-the-c-iostream-endl-fiasco

It is some people's opinion mine included that std endl shouldn't even be in the standard as it is so rarely appropriate and not..

Is short-circuiting boolean operators mandated in C/C++? And evaluation order?

http://stackoverflow.com/questions/628526/is-short-circuiting-boolean-operators-mandated-in-c-c-and-evaluation-order

C I'm confused for I recall the K R book saying your code shouldn't depend on these operations being short circuited for they may.. that evaluation order isn't strictly defined so your code shouldn't depend or assume functions within an expression would be executed..

When should I use the new keyword in C++?

http://stackoverflow.com/questions/655065/when-should-i-use-the-new-keyword-in-c

is no longer allocated when it goes out of scope. i.e. you shouldn't return a pointer to an object on the stack As far as which one.. calling delete and the potential to cause memory leaks you shouldn't use new . If you'd like to return a pointer to your object from..

Accessing class members on a NULL pointer

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

that your code appears to run exactly as you intended. You shouldn't rely on that although you will sometimes find libraries from..

Subclass/inherit standard containers?

http://stackoverflow.com/questions/6806173/subclass-inherit-standard-containers

class each will full implementations. Hierarchies shouldn't be deep almost always two levels. Only use more than two when..

How should I detect unnecessary #include files in a large C++ project?

http://stackoverflow.com/questions/74326/how-should-i-detect-unnecessary-include-files-in-a-large-c-project

at compile time. This can help in identifying files that shouldn't need to be included. You can also take a look at the pimpl idiom..

Which kind of pointer do I use when?

http://stackoverflow.com/questions/8706192/which-kind-of-pointer-do-i-use-when

its lifetime not to break cycles. Cycles with shared_ptr shouldn't normally happen two resources can't own each other. Note that..

What should be the sizeof(int) on a 64-bit machine? [duplicate]

http://stackoverflow.com/questions/10197242/what-should-be-the-sizeofint-on-a-64-bit-machine

respectively In my machine I found the WORD_BIT is 32 . Shouldn't it be 64 on a 64 bit machine getconf WORD_BIT 32 And shouldn't..

Name lookups in C++ templates

http://stackoverflow.com/questions/10639053/name-lookups-in-c-templates

that explanation was useful I still have some questions. Shouldn't the fact that my function takes a T pointer to type T make it..

Including header files in C/C++ just once

http://stackoverflow.com/questions/10877494/including-header-files-in-c-c-just-once

pragma once but why should you have to specify even that Shouldn't it be the default behavior of the compiler to include files..

Why are function pointers and data pointers incompatible in C/C++?

http://stackoverflow.com/questions/12358843/why-are-function-pointers-and-data-pointers-incompatible-in-c-c

but is not guaranteed to work. Why is this the case Shouldn't both be simply addresses into main memory and therefore be compatible..

Local variable scope question

http://stackoverflow.com/questions/1388685/local-variable-scope-question

scope question Why is the following code prints xxY Shouldn't local variables live in the scope of whole function Can I use..

C++11 “Non-movable” type [duplicate]

http://stackoverflow.com/questions/14085553/c11-non-movable-type

marked deleted here A A delete ^ 1 error generated. Shouldn't the compiler use the copy constructor if the move constructor..

pointer as non-type template argument

http://stackoverflow.com/questions/15885399/pointer-as-non-type-template-argument

know much about addresses. Yet why isn't it allowed Shouldn't it be possible for the compiler to use something similar to..

g++ error: ?˜stricmp??was not declared in this scope (but OK for 'strcmp')

http://stackoverflow.com/questions/1784767/g-error-stricmp-was-not-declared-in-this-scope-but-ok-for-strcmp

of stricmp then everything is fine What can be wrong here Shouldn't stricmp be allowed when strcmp is allowed Sureley this all could..

Problem with protected fields in base class in c++

http://stackoverflow.com/questions/1813671/problem-with-protected-fields-in-base-class-in-c

DerivedClass like class DerivedClass public BassClass . Shouldn't DerivedClass inherit the protected fields from BassClass When..

decltype and parenthesis

http://stackoverflow.com/questions/3097779/decltype-and-parenthesis

const double Why do the parenthesis make a difference here Shouldn't it simply be double like in the line above c c 11 type inference..

Inheriting constructors

http://stackoverflow.com/questions/347358/inheriting-constructors

8 note candidates are B B main.cpp 8 note B B const B& Shouldn't B inherit A's constructor this is using gcc c inheritance gcc..

C++ : What's the easiest library to open video file

http://stackoverflow.com/questions/37956/c-whats-the-easiest-library-to-open-video-file

field so some codec are actually only for QuickTime . Shouldn't be too difficult to implement. Gstreamer latest open source..

Question on multiple inheritance, virtual base classes, and object size in C++

http://stackoverflow.com/questions/396327/question-on-multiple-inheritance-virtual-base-classes-and-object-size-in-c

sizeof z endl Why is sizeof z more 20 in the first case Shouldn't it be 12 since Base will be included only once in Z c multiple..

Memory allocation in C++

http://stackoverflow.com/questions/4687310/memory-allocation-in-c

of the object stored on stack Sounds contradictory to me. Shouldn't the lifetime of pubvar and pBar be the same c memory management..

Why is the linux kernel not implemented in C++? [closed]

http://stackoverflow.com/questions/520068/why-is-the-linux-kernel-not-implemented-in-c

still so prominent when it comes to OS programming Shouldn't C have replaced it a long time ago as its successor c operating..

Reading binary istream byte by byte

http://stackoverflow.com/questions/5513532/reading-binary-istream-byte-by-byte

bytes are skipped. I've opened the stream in binary mode. Shouldn't that prevent it from interpreting line separators Do extraction..

C++ overload resolution

http://stackoverflow.com/questions/72010/c-overload-resolution

statement b A DoSomething rather than just b DoSomething Shouldn't the compiler's overload resolution figure out which method I'm..

Do I need to manually close a ifstream?

http://stackoverflow.com/questions/748014/do-i-need-to-manually-close-a-ifstream

file not found Do I need to call file.close manually Shouldn't ifstream make use of RAII for closing files I've searched through..

Conflict between copy constructor and forwarding constructor

http://stackoverflow.com/questions/9287250/conflict-between-copy-constructor-and-forwarding-constructor

find a match with the base class' constructor template. Shouldn't it be calling MyBase automatic copy constructor for its own..

C++ rand() between 0 and 1

http://stackoverflow.com/questions/9878965/c-rand-between-0-and-1

Why does having r double rand RAND_MAX 1 make 1 r 0 Shouldn't adding one to RAND_MAX make 1 r 2 Edit I was getting a warning..