[range] indirected requirements for custom smart pointer

Using boost::adaptors::indirected with a custom templated smart pointer failed compilation due to missing MyCustomSmartPointer::element_type typedef. Indeed supplying this typedef, all compiles and tests run. Is this the canonical approach to making a compatible pointer type usable with range? Is this specific to range only? Will this make my custom smart pointer 'more' compatible with other boost/std facilities? Thanks, Jeff

On Thu, Jun 21, 2012 at 6:41 AM, Jeff Flinn
Using boost::adaptors::indirected with a custom templated smart pointer failed compilation due to missing MyCustomSmartPointer::element_**type typedef. Indeed supplying this typedef, all compiles and tests run.
Is this the canonical approach to making a compatible pointer type usable with range? Is this specific to range only? Will this make my custom smart pointer 'more' compatible with other boost/std facilities?
My guess is "yes", based on http://www.boost.org/doc/libs/1_49_0/libs/iterator/doc/pointee.html I'm guessing the pointee and indirect_reference metafunctions are what indirected_range uses to infer its value_type and reference/const_reference. But, to be sure, one would have to check the code. - Jeff
participants (2)
-
Jeff Flinn
-
Jeffrey Lee Hellrung, Jr.