Policy Based Design Using C++ Typemaps
1.0.1

template 
class ImageFile {
  private :
    typedef typename typemap::find::X::Value ErrorPolicy ;
    typedef typename typemap::find::X::Value ThreadingPolicy ;

    typedef typename typemap::find::X::Value ImageFormats ;

    ...

  public :
    bool load(const string_type &filename)
    {
      typemap::for_each load_image ;
      
      if ( load_image(filename) )
        return true ;
      return false ;
    }
        
  private :
    template 
    struct FormatCheck {
      bool operator()(const std::string &filename)
      {
        ...
      }
    } ;    
} ;

 
Copyright (C) 2005,2006,2013 Andre Mirzoyan