Your output doesn’t account for the Test’s copy constructor, which std::vector
is apt to use.
The Test object you see get created is the temporary passed to push_back()
, not the one actually in the vector
.
More Related Contents:
- Why I am getting Time Limit Exceeded? [closed]
- Using paragraphs 8.5.3p4 and p5 in the C++11 Standard, how do I prove that the snippet below doesn’t compile?
- Using base pointer register in C++ inline asm
- Compilers and argument order of evaluation in C++
- C state-machine design [closed]
- Why does this C++ snippet compile (non-void function does not return a value) [duplicate]
- Calling a python method from C/C++, and extracting its return value
- On which platforms does integer divide by zero trigger a floating point exception?
- End of File(EOF) of Standard input stream (stdin)
- How to properly free the memory allocated by placement new?
- C++ where to initialize static const
- GetDIBits and loop through pixels using X, Y
- in C++ , what’s so special about “_MOVE_H”?
- In what ways do C++ exceptions slow down code when there are no exceptions thown?
- Should I pass an std::function by const-reference?
- Reinterpret_cast vs. C-style cast
- C++ Get all bytes of a file in to a char array?
- What is the behavior of “delete” with stack objects? [duplicate]
- What are good practices regarding shared libraries on Linux?
- Passing as const and by reference – Worth it? [duplicate]
- Memory Allocation char* and char[]
- How to load a custom binary resource in a VC++ static library as part of a dll?
- shared_ptr and weak_ptr differences
- Is is a good practice to put the definition of C++ classes into the header file?
- Address of labels (MSVC)
- Can you start a class name with a numeric digit?
- QT QWebEnginePage::setWebChannel() transport object
- Scope resolution operator being used twice
- narrowing conversion from unsigned to double
- Why does this simple std::thread example not work?