Changes between Version 3 and Version 4 of Ticket #9035, comment 1


Ignore:
Timestamp:
Aug 22, 2013, 4:06:55 PM (9 years ago)
Author:
olli

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9035, comment 1

    v3 v4  
    1 boost::coroutines::coroutine<X*>::push_type is not possible with the new version
    2 (boost::coroutines::coroutine<X*()> is deprecated)
     1add
     2   X() {
     3        std::cout << "X()" << std::endl;
     4    }
     5
     6    ~X() {
     7        std::cout << "~X()" << std::endl;
     8    }
     9
     10    void g() {
     11        std::cout << "X::g()" << std::endl;
     12    }
     13
     14
     15and the output will be:
     16
     17X()
     18~X()
     19X::g()
     20
     21the stack gets unwound but the objects (bit structure) is still available.
     22
     23change X to:
     24
     25struct X {
     26
     27    int x;
     28    X() : x( 1) {
     29        std::cout << "X(): " << x << std::endl;
     30    }
     31
     32    ~X() {
     33        x = 7;
     34        std::cout << "~X(): " << x << std::endl;
     35    }
     36
     37    void g() {
     38        std::cout << "X::g(): " << x << std::endl;
     39    }
     40
     41};
     42
     43and you will get your segmentation fault (gcc + clang)