On 30 อมา, 18:22, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Thank you for the answer :)
class A {};
class A { public: static int var = WELL_KNOWN_VALUE; };
A f();
template<int astruct Z {};
See, it wasn't that difficult, was it? So, why use so many English
words when you could have written it in C++?
I am not very familiar with google groups formatting rules, so I was
not sure would my code here be readable at all
What you could do, I suppose, is use
Z< std::tr1::result_of(f)::type::var z;
Hmm...it doesn't work with my issue. result_of works with function,
not function call, but I need to work with function template with
return type instantiation depending on it's arguments. Look at the
example :
template <typename R, typename A1>
boost::mpl::vector<A1GetArgs(R (*f) (A1));
template <typename R, typename A1, typename A2>
boost::mpl::vector<A1, A2GetArgs(R (*f) (A1, A2));
Z< std::tr1::result_of( GetArgs(&f1) )::type::var z // error :
function call in static
Z< std::tr1::result_of( &GetArgs )::type::var z // error : result
type is undefined
So return type of my function depends on it's arguments. But I cannot
provide arguments to function while calling result_of. Even worse, I
cannot provide template with explicit types because there's no
possibility to obtain a signature from a function : I must use type
propogation (which works with function templates), but it is necessary
to provide template with real arguments for the compiler to be able to
propogate types...
AFAIUI, (see more of technical report in the Committee documents).
Haven't found anything usable yet :(
See above, but note that not all compilers have implemented TR1 yet.
I used boost::utility library : it shares result_of class with TR1
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Any ideas ?..
Best Regards, Paul Sujkov