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 3: Type Detection, Type Fixing, and Type Selection at work.
template <typename C>
class sequence_range
{
private:
// Type Detection
enum { C_HAS_MUTABLE_INTERFACE = . . . ??? . . . };
// Type Fixing
typedef typename typefixer_iterator<C
, C_HAS_MUTABLE_INTERFACE
>::iterator putative_iterator;
public:
typedef typename C::const_iterator const_iterator;
// Type Selection
typedef typename select_first_type< putative_iterator
, const_iterator
, C_HAS_MUTABLE_INTERFACE
>::type iterator;
...