Boost logo

Boost Users :

From: Victor Morilla (victormorilla_at_[hidden])
Date: 2004-10-10 18:10:28


Guess someone why this code fails ? (g++3.3)

---- begin -----------------------

#include <boost/type_traits.hpp>
#include <iostream>

using namespace std;
using namespace boost;

int foo() { return 10; }

template <typename FnType, FnType* fn,
          int Arity = function_traits<FnType>::arity>
struct Translator;

template <typename FnType, FnType* fn>
struct Translator<FnType, fn, 0> :
function_traits<FnType>
{
  typedef result_type type;
};

int main(int argc, char** argv)
{
  Translator<int (), &foo>::type x;
}
 ------------------- end code ------------------
error: ISO C++ forbids declaration of `result_type'
with no type
--------------------- end error -------------------

And another question: is there a portable equivalent
to:

       Translator<typeof(foo), &foo>

Thanks

                
______________________________________________
Renovamos el Correo Yahoo!: ˇ100 MB GRATIS!
Nuevos servicios, más seguridad
http://correo.yahoo.es


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net