Adapting Interface-Incomplete Types at Compile Time
By Matthew Wilson, December 01, 2005
When an adapter template makes demands that a potential underlying type cannot fulfill, Interred Interface Adaptation can expand the number of adaptable types.
December, 2005: Adapting Interface-Incomplete Types At Compile Time
Example 1: Supporting mutating and nonmutating access to the elements of the underlying collection.
typedef sequence_range<std::vector<int> > range_t;
void f1(range_t &r);
void f2(range_t const &r);
range_t r;
const range_t cr;
f1(r); // non-const passed as non-const - Ok
f2(r); // non-const passed as const - Ok
f2(cr); // const passed as const - Ok
f1(cr); // const passed as non-const - compile error