'boost::enable_shared_from_this<net::Session>' is an inaccessible base of 'net::Session' BOOST_ASSERT( p.get() == this );
在使用enabel_shared_from_this是遇到報錯
研究了一下是繼承的時候沒有采用public繼承的原因
https://blog.csdn.net/crazyhacking/article/details/8013458
這個文章指明private/protected繼承時A的指針不能指向B
不過感覺沒理解,如果看這個文章c++三種繼承方式public,protect,private
可能是protected繼承使得this指針對子類不可訪問。接下來進行測試
額,很奇怪,測試結果好像沒啥問題,測試了幾種可能性:
在protected繼承下
1.Base使用了this的函數不能被Derived調用 X
2.Base的this和Derived*不能做==操作 X