// ----------------------------------------------------------------------
//
// mem_fun1.cc - Do we support the 3-argument forms of mem_fun?
//
// History:
//   17-May-2000  WEB  Initial draft
//   06-Feb-2001  WEB  Add tests for the _ref forms
//   25-Apr-2001  WEB  s/<ISOcxxSyntax.hh>/"ISOcxx\/ISOcxxSyntax.hh"/
//
// ----------------------------------------------------------------------


#include "ISOcxx/ISOcxxSyntax.hh"


#include <functional>


struct C  {

  C()  { ; }

  int  f( char c );
  int  g( char c ) const;

};  // C

int  C::f( char c )        { return 0; }
int  C::g( char c ) const  { return 0; }


int  main()  {

  C        c;
  C const  cc;

  std::mem_fun1_t      <int,C,char>  mf1t  = std::mem_fun( &C::f );
  std::const_mem_fun1_t<int,C,char>  cmf1t = std::mem_fun( &C::g );

  std::mem_fun1_ref_t      <int,C,char>  mf1rt  = std::mem_fun_ref( &C::f );
  std::const_mem_fun1_ref_t<int,C,char>  cmf1rt = std::mem_fun_ref( &C::g );

  return mf1t (&c,'f') + cmf1t (&cc,'g')
       + mf1rt( c,'f') + cmf1rt( cc,'g')
       ;

}  // main()
