@vzevi2yd: "I am trying to understand the behaviour for the following two cases:
class A {
    virtual  funcA() {i++;};       // case 1
    funct A() {i++;};                // case 2
private:
    int i;
};
main ()
{
    A *a = new A();
    A *b = a;
    delete a;
    b->functA()
}
case 1 fails (is this because it has to go thru vptr table and the object is 
gone)
case 2 ok. (is this because its static binding. Though no object. Isn't this 
unsafe?)
Also, are default constructor, copy constructor etc required from mere 
presence
of any virtual function (non-trivial case) in  a class?
thanks"
    @ambivali: ""V Patel" <email_address> wrote in message 
news:kYvvh.50$<email_address>
<quote>
Sorry for a bit sloppy in the original example. The class does not have any 
constructor.
For both test-cases, the functA() returns void.
class A {
    virtual void funcA() {i++;};       // case 1
    void functA() {i++;};                // case 2
    // no constructor or destructor.
 private:
    int i;
};
 int main ()
{
    A *a = new A();
    A *b = a;
    delete a;
    b->functA();
    return 0;
 }"
{'source': 'USENET', 'other_information': '{"reply_count": 1, "forum_name": "comp.lang.c++.20141115.mbox"}', 'file': 'data/output/usenet-comp.lang.parquet'}