From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-01-14 10:10:31
From: "Beman Dawes" <bdawes_at_[hidden]>
> Yes, agreed. This is the approach Peter Dimov has been advocating. But I
> can't get it to compile with either GCC 3.0.1 or VC++7.0b2. See code
> GCC says:
> policy_ptr.cpp: In instantiation of `default_checking<int, policy_ptr<int,
> default_checking, default_storage> >':
> policy_ptr.cpp:37: instantiated from `policy_ptr<int, default_checking,
> policy_ptr.cpp:37: instantiated from here
> policy_ptr.cpp:34: no type named `storage_policy' in `class
> default_checking, default_storage>'
> line 34 is the line that reads: void check(
> typename SmartPtr::storage_policy::pointer_type p ) const
> Any ideas?
You can't access SmartPtr::storage_policy in a member declaration since
SmartPtr is incomplete at this point.
You can access it in the member function body, though.
Tying this to my previous question, what is the reason of the 'pointer_type'
(over)generalization? When is pointer_type not T*? std::allocator flashes?
-- Peter Dimov Multi Media Ltd.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk