Click here to Skip to main content
15,887,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: inheriting std::vector Pin
Chris Losinger17-Jun-10 9:14
professionalChris Losinger17-Jun-10 9:14 
GeneralRe: inheriting std::vector Pin
VeganFanatic17-Jun-10 9:18
VeganFanatic17-Jun-10 9:18 
GeneralRe: inheriting std::vector Pin
Chris Losinger17-Jun-10 9:22
professionalChris Losinger17-Jun-10 9:22 
GeneralRe: inheriting std::vector Pin
VeganFanatic17-Jun-10 9:25
VeganFanatic17-Jun-10 9:25 
GeneralRe: inheriting std::vector Pin
Chris Losinger17-Jun-10 9:28
professionalChris Losinger17-Jun-10 9:28 
GeneralRe: inheriting std::vector Pin
Stephen Hewitt17-Jun-10 14:05
Stephen Hewitt17-Jun-10 14:05 
GeneralRe: inheriting std::vector Pin
Chris Losinger17-Jun-10 16:34
professionalChris Losinger17-Jun-10 16:34 
GeneralRe: inheriting std::vector Pin
Emilio Garavaglia18-Jun-10 3:12
Emilio Garavaglia18-Jun-10 3:12 
Chris, those links are "things to be noted" not "the Bible".
The STL itself is designed by inheriting between classes that don't have virtual destructor. Think to iofstream versus istream and ostream

STL containers don't have virtual destructors because they are designed to be non-polymophic and to exist into a closed scope.

If you respect this, that means don't do things like (pseudocode)
vector* p = new myvector;
delete p; //worng: will destroy only "vector" not "myvector"


but just
{
   myvector v;
   //whatever you want with v, including vector functionality
}


you are in any case in a right position.

2 bugs found.
> recompile ...
65534 bugs found.
D'Oh! | :doh:


GeneralRe: inheriting std::vector Pin
Chris Losinger18-Jun-10 11:17
professionalChris Losinger18-Jun-10 11:17 
Questionscan array of byte Pin
rockago17-Jun-10 8:25
rockago17-Jun-10 8:25 
AnswerRe: scan array of byte Pin
Niklas L17-Jun-10 8:34
Niklas L17-Jun-10 8:34 
GeneralRe: scan array of byte Pin
rockago17-Jun-10 8:48
rockago17-Jun-10 8:48 
GeneralRe: scan array of byte Pin
Niklas L17-Jun-10 9:11
Niklas L17-Jun-10 9:11 
QuestionRe: scan array of byte Pin
David Crow17-Jun-10 9:11
David Crow17-Jun-10 9:11 
QuestionEnumwindows hangs (freezing) application any idea? Pin
ERLN17-Jun-10 8:07
ERLN17-Jun-10 8:07 
QuestionRe: Enumwindows hangs (freezing) application any idea? Pin
David Crow17-Jun-10 9:07
David Crow17-Jun-10 9:07 
AnswerRe: Enumwindows hangs (freezing) application any idea? Pin
rp_suman17-Jun-10 19:07
rp_suman17-Jun-10 19:07 
GeneralRe: Enumwindows hangs (freezing) application any idea? Pin
ERLN17-Jun-10 22:28
ERLN17-Jun-10 22:28 
QuestionA Doubt Pin
Benjamin Bruno17-Jun-10 7:57
Benjamin Bruno17-Jun-10 7:57 
AnswerRe: A Doubt Pin
Niklas L17-Jun-10 8:08
Niklas L17-Jun-10 8:08 
GeneralRe: A Doubt Pin
Chris Losinger17-Jun-10 9:18
professionalChris Losinger17-Jun-10 9:18 
GeneralRe: A Doubt Pin
Niklas L17-Jun-10 9:20
Niklas L17-Jun-10 9:20 
GeneralRe: A Doubt Pin
Chris Losinger17-Jun-10 9:23
professionalChris Losinger17-Jun-10 9:23 
GeneralRe: A Doubt Pin
Aescleal17-Jun-10 9:32
Aescleal17-Jun-10 9:32 
GeneralRe: A Doubt Pin
Niklas L17-Jun-10 9:47
Niklas L17-Jun-10 9:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.