
12 Jun
2010
12 Jun
'10
1:21 a.m.
On 6/11/2010 6:14 PM, Neal Becker wrote:
IIUC, in typical usage, the default constructor will be called. Here is my example: [...] This is a bit confusing. IIUC, the issue is that we did not explicitly invoke the super_t constructor, so we got the default constructor, which in turn calls (iterator_adaptor.hpp:280)
iterator_adaptor() {}
Adding an explicity super_t constructor call fixes it: [...] But is not very obvious.
How so? Makes sense to me that you should be conscious of how the base class is constructed (assuming it is nontrivial) in all the derived class' constructors, regardless of the context... - Jeff